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

网站建设 2021-07-03 08:43www.dzhlxh.cn网站建设
很老的问题了,如今再次碰到,记录下来,给后来者方便!

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

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板