Dan*_*ern 7 css firefox conditional
我在firefox中遇到css问题,因此我只想在浏览器为FF时导入一个css文件
实际上,我需要导入这个样式:
.searchbutton{
position:absolute; right:3px; width:25px;
top:3px;
}
#buscarmain{ bottom:12px;
}
Run Code Online (Sandbox Code Playgroud)
编辑:
许多人认为我不应该对FF使用特殊声明,因为与其他浏览器相比,FF最有可能是正确的.
但是,在这种情况下,所有浏览器都打印相同的页面(IE,Chrome,Opera,Safari),FF以其他方式显示它.我必须为所有浏览器实现相同的可视化,因此我需要一个特殊的FF语句
J. *_*uni 13
以下是我们如何仅针对Firefox定位CSS样式:
<style type="text/css">
@-moz-document url-prefix() {
h1 {
color: red;
}
}
</style>
Run Code Online (Sandbox Code Playgroud)
解决了这个问题
刚刚添加:
<script type="text/javascript">
if ( $.browser.mozilla == true ) {
document.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"FF.css\">");
}
</script>
Run Code Online (Sandbox Code Playgroud)