之前只有ie6、ie6、firefox時,只要寫!important就能夠零丁給firefox做hack了,可是此刻多了ie八、opera、chrome等這些個所說的規(guī)范瀏覽器后,firefox能熟悉的工具它們都熟悉,偏生firefox有個致命的bug就是不撐持input的line-height屬性,于是我又犯合計(jì)了,怎么辦怎么辦怎么怎么辦呢?
網(wǎng)上搜刮一大圈,終于發(fā)明1個好措施,那就是@-moz-documenturl-prefix(){這搭是放css語句的處所},恁地龐大的一句話,只有firefox熟悉,如許就能夠給firefox配置至有關(guān)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;}}
新聞熱點(diǎn)
疑難解答
圖片精選