首页 > Web开发 > 详细

Firefox下input button内文字不能垂直居中的解决方法

时间:2015-12-07 02:01:26      阅读:175      评论:0      收藏:0      [点我收藏+]
很老的问题了,如今再次碰到,记录下来,给后来者方便!

众所周知,在Firefox下input type=”button”的文字是不好居中的,原因在于Firefox自己比较二,弄了个私有属性,导致以下问题的出现:

1.按钮左右本身有2px的间距(FF私有属性写了padding:0 2px所致);
2.按钮文字居中是不行的(此时设置padding-bottom是没用的) ;
3.等等…
解决办法:

复制代码
代码如下:

input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner{
border:none;padding:0;
}

Firefox下input button内文字不能垂直居中的解决方法

原文:http://www.jb51.net/css/95436.html

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