0
我想垂直居中這些超鏈接。但是,我無法弄清楚我在我的css代碼中遺漏了什麼。我錯過了什麼?如何垂直對齊此超鏈接按鈕?
<tr>
<td id="nav"><a href="demopage.html">1</a></td>
<td id="nav"><a href="demopage.html">2</a></td>
<td id="nav"><a href="demopage.html">3</a></td>
</tr>
<tr style="height: 45px">
<td id="nav"><a href="demopage.html">4</a></td>
<td id="nav"><a href="demopage.html">5</a></td>
<td id="nav"><a href="demopage.html">6</a></td>
</tr>
CSS代碼:
#nav a {
text-decoration:none;
display:block;
background-color:#99ccff;
border: 1px solid #000000;
list-style-type: none; margin:0; padding:0;
width: 125px;
height: 25px;
text-align:center;
vertical-align:middle;
margin-top: auto
}
#nav a:link {
color:black;
}
#nav a:visited {
color:#000000;
}
#nav a:hover {
color:#000000;
background-color:#EAEAEA;
}