CSS Hack to Target Firefox 3.5+?

3 css firefox

Firefox 3.5现在支持nth-*伪类,这就是我用来定位Safari和Chrome的CSS的方法.现在Firefox也会读取这些内容,导致布局问题.有没有人知道专门针对FF 3.5+的方法?

BODY:nth-of-type(1) #topsearch input[type=submit] /* Safari 3.1+ and Chrome */ { 
     height:19px 
}
Run Code Online (Sandbox Code Playgroud)

Pau*_*aul 5

怎么样,我在Safari 4中进行了测试,高度为19px,在Firefox 3.5中,高度显示为39px.

<style>

BODY:nth-of-type(1) #topsearch input[type=submit] /* Safari 3.1+ and Chrome */ { height:19px }      
BODY:nth-of-type(1) #topsearch input[type=submit], x:-moz-any-link, x:default { height: 39px; }

</style>
Run Code Online (Sandbox Code Playgroud)


Bru*_*eod 5

CSS浏览器选择器允许您编写针对特定浏览器的CSS,而无需担心黑客攻击.我不能高度推荐它.