Firefox专属hack的写法介绍


之前只有ie6、ie6、firefox时,只要写!important就能够零丁给firefox做hack了,可是此刻多了ie八、opera、chrome等这些个所说的规范浏览器后,firefox能熟悉的工具它们都熟悉,偏生firefox有个致命的bug就是不撑持input的line-height属性,于是我又犯合计了,怎么办怎么办怎么怎么办呢?

网上搜刮一大圈,终于发明1个好措施,那就是@-moz-documenturl-prefix(){这搭是放css语句的处所},恁地庞大的一句话,只有firefox熟悉,如许就能够给firefox配置至有关line-height的padding了。

举个例子,本来1个按键的css是如许

复制代码
代码如下:

.defaultmallsearchbt{width:70px;height:22px;line-height:22px;padding-left:16px;color:#fff;border:none;background:url(../images/defaultmallsearchbt.gif)no-repeat;cursor:pointer;}

可是在firefox下书契在按键上是没有铅直居中的,以是要加之如许一句:

复制代码
代码如下:

@-moz-document url-prefix(){.defaultmallsearchbt{padding:0 0 4px16px;}}

疑难题目目解释题决,万事大吉!

复制代码
代码如下:

.input2{width:30px;height:21px;padding-top:4px;border:1px solid#d5d5d5;position:relative;*top:4px;}
@-moz-document url-prefix(){.input2{top:2px;}}

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3