设置了文字了小于12px时,会存在设置了line-height的不生效的问题,主要是由于基线的问题,这篇文章解释的很清楚,有兴趣的可以看下https://blog.csdn.net/q121516340/article/details/51483439
方法1:
使用CSS3 scale属性,设置时将所有的值设置大一倍,然后缩小一倍
height: 32px;
line-height: 32px;
font-size: 20px;
text-align: center;
transform: scale(0.5);
方法2:直接用定位,只是比较傻的方法