我正在使用“ a”标签并将其样式设置为稍大一些,但我似乎无法使文本在中间对齐。我尝试添加填充,但这只会使其变得更大。现在,文字在左上角,但我想让它居中,有什么想法吗?
<a href="#">text</a>
a {
width: 196px;
height: 64px;
background-color: blue;
border: 0px none;
font-size: 20px;
color:white;
}
a {
width: 196px;
height: 64px;
background-color: blue;
border: 0px none;
font-size: 20px;
color:white;
display:inline-block; /* if more items are in line */
line-height:64px; /* if one line of text is in question */
text-align:center;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句