我认为line-height
会垂直居中对齐文本。但是这不是我的按钮。为什么?如何垂直居中对齐按钮内的文字?
该文本在FF,Opera和Safari中对齐。
<button class="get_discount_rate">Button</button>
button {
font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
color: #444;
min-width: 90px;
height: 24px;
line-height: 24px;
margin: 5px 10px;
background-color: #fdfdfd;
border: 1px solid #cdcdcd;
cursor: pointer;
border-radius: 3px;
}
行高:汽车; – jm666 2012-07-21 22:37:07
或更好,然后,只需从css规则中删除行高属性 – asprin 2012-07-21 23:15:27
是的,谢赫Heera只是证明了它:) – Steven 2012-07-21 23:15:59