<style type="text/css">
td#td1 a
{
text-decoration:none;
background:transparent url(images/1.jpg) no-repeat;
display:block;
width:260px;
line-height:88px;
}
td#td1 a:hover
{
background:transparent url(images/1-1.jpg);
display:block;
width:260px;
line-height:88px;
}
td#td2 a
{
text-decoration:none;
background:transparent url(images/2.jpg) no-repeat;
display:block;
width:260px;
line-height:88px;
}
td#td2 a:hover
{
background:transparent url(images/2-2.jpg);
display:block;
width:260px;
line-height:88px;
}
td#td3 a
{
text-decoration:none;
background:transparent url(images/3.jpg) no-repeat;
display:block;
width:260px;
line-height:88px;
}
td#td3 a:hover
{
background:transparent url(images/3-3.jpg);
display:block;
width:260px;
line-height:88px;
}
</style>
<TABLE id=nav cellSpacing=0 cellPadding=0 width=800 border=0>
<TBODY>
<TR>
<td width="5"></td>
<TD id=td1 width=150 height=30><A href="#"> </A></TD>
<td width="5"></td>
<TD id=td2 width=150 height=30><A href="#"> </A></TD>
<td width="5"></td>
<TD id=td3 width=150 height=30><A href="#"> </A></TD>
<td width="5"></td>
</TR>
</TBODY></TABLE>
本文详细介绍了如何使用CSS对HTML表格进行美化,包括不同单元格状态下的背景变化效果,以及如何通过CSS选择器实现鼠标悬停时的样式切换。通过具体代码示例展示了如何设置单元格的宽度、高度以及链接的表现形式。
4328

被折叠的 条评论
为什么被折叠?



