我已经花了几个小时,我认为这样做要简单得多。我试图将 3 个 div 水平居中,同时保持它们完全可链接,我最终放弃了并尝试了表格(:-o )
第一个显示我尝试链接 div 失败。
<center><table>
<tr>
<td>
<a href="http://google.com" style="display:block;height:100%;width:100%">
<div>
a
</div>
</a>
</td>
<td>b</td>
<td>c</td>
</tr>
</table>
使用 CSS
tbody tr td{
width: 300px;
height: 200px;
border: 2px solid #000;
background-color: #000;
opacity: 0.7;
color: #fff;
font-size: 30px;
font-family: 'calibri'; //temporary
padding: 30px;
}
body center table
{
border-spacing: 20px;
margin-top: -90px;
}
tr td a{
height:150%;
width:150%;
}
如果有人知道如何使用 div 或表格执行此操作,我们将不胜感激!