Firefox下input button内文字不能垂直居中的解决方法
Firefox下input button内文字不能垂直居中的解决方法
发布时间:2016-12-27 来源:查字典编辑
摘要:很老的问题了,如今再次碰到,记录下来,给后来者方便!众所周知,在Firefox下inputtype=”button”...

很老的问题了,如今再次碰到,记录下来,给后来者方便!

众所周知,在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;

}

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新 Div+Css教程学习
热门 Div+Css教程学习
网页设计子分类