首页 > 其他 > 详细

Firefox专属hack的写法

时间:2015-10-10 14:00:03      阅读:180      评论:0      收藏:0      [点我收藏+]

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

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

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

.defaultmallsearchbt{width:70px;height:22px;line-h eight: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 4px 16px;}}

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

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

Firefox专属hack的写法

原文:http://www.cnblogs.com/maixi/p/4866662.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!