我试图使一个链接,其中有一个height
和一个200px的width
。链接的文本应垂直居中和水平居中。
到目前为止,这是我的CSS:
a:link.Kachel {
width: 200px;
height: 200px;
margin: 0 auto;
display: block;
text-align: center;
background: #383838;
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-align: center;
-moz-box-align: center;
box-align: center;
}
这是HTML代码:
<tr>
<td>
<a class="Kachel" href="#">Test</a>
</td>
</tr>
文本水平居中,而不是垂直居中。
你知道如何让文本在水平方向和垂直方向上居中吗?
https://stackoverflow.com/questions/14862604
复制相似问题