只适用于 Chrome 的 CSS?

标签 css internet-explorer firefox google-chrome

<分区>

这是我的网站:http://portable-ebook-reader.net

顶部的搜索栏由两张背景图片组成。一个是您要输入搜索词组的位置,第二个是要搜索的实际按钮。

我的问题是,在 Chrome 中,搜索按钮图像 2px 太高了。但它在 IE 和 FF 中看起来很完美。如果我修改 CSS(margin-top:2px),那么 Chrome 看起来不错,但 IE 和 FF 就乱七八糟了。

有什么想法吗?我一直在寻找几个小时,但没有任何运气。

谢谢!

最佳答案

要使用仅适用于 Webkit 浏览器(Chrome 和 Safari)的 CSS:

@media screen and (-webkit-min-device-pixel-ratio:0) { 
    #searchsubmit { height: 20px; }
    #s { margin-top: 5px; } 
}

一个丑陋的 hack,但它可以解决那些令人沮丧的渲染问题。

关于只适用于 Chrome 的 CSS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2197913/

相关文章:

Html css 图片问题 windows IE FF GChrome

javascript - 如何阻止一行 JavaScript 在 IE 中运行(但让它在其他浏览器中运行)?

firefox - Webdriver 45000 毫秒后无法连接到端口 7055 上的主机 127.0.0.1

html - Div 的外观不同(Firefox 与 Internet Explorer)

javascript - Apache echarts 中拖动垂直标记线

html - br :last-child not working when an element is after the br

html - CSS Responsive - 更改 div 的顺序

css - Font Awesome 5 在使用 JS+SVG 版本时显示空方 block

javascript - IE 使用 JQuery 做了一些奇怪的事情

regex - JavaScript : split doesn't work in IE?