【发布时间】:2014-12-30 13:21:30
【问题描述】:
NEWBIE:我目前正在开发一个 1and1 网站。我希望主页上的不同框都链接到不同的子页面。每个框都包含一个图像和图像下方的“类别”文本。由于边框的原因,我使用表格中的表格来创建框。我还添加了悬停效果,因此当您将鼠标悬停在任何这些框/表格上时,背景会改变颜色。我想做的是让文本在改变颜色的同时改变颜色。我应该指出,我对 CSS 一无所知,对 HTML 知之甚少,所以一个可行的例子会让我很开心!提前致谢。到目前为止,这是我拼凑起来的:
<table border="0" cellpadding="10" cellspacing="10" style="width: 685px;">
<tbody>
<tr>
<td>
<table bgcolor="#F7F7F3" border="1" bordercolor="#89A6A1" cellpadding="3" cellspacing="3" onmouseout="this.bgColor='#f7f7f3'" onmouseover="this.bgColor='#89A6A1'; this.style.color='black'" style="width: 100%; color: black;">
<tbody>
<tr>
<td>
<p><a href=""><img a="" alt="Awaiting Image" src="" style="width: 100%; max-width: 219px; height:auto; horizontal-align: center;" /></a></p>
<p> </p>
<p><strong><span style="color:#89A6A1;">Category</span></strong></p>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table bgcolor="#f7f7f3" border="1" bordercolor="#89A6A1" cellpadding="3" cellspacing="3" onmouseout="this.bgColor='#f7f7f3'" onmouseover="this.bgColor='#89A6A1'" style="width: 100%;">
<tbody>
<tr>
<td>
<p><a href=""><img a="" alt="Awaiting Image" src="" style="width: 100%; max-width: 219px; height:auto; horizontal-align: center;" /></a></p>
<p> </p>
<p><strong><span style="color:#89A6A1;">Category</span></strong></p>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table bgcolor="#f7f7f3" border="1" bordercolor="#89A6A1" cellpadding="3" cellspacing="3" onmouseout="this.bgColor='#f7f7f3'" onmouseover="this.bgColor='#89A6A1'" style="width: 100%;">
<tbody>
<tr>
<td>
<p><a href=""><img a="" alt="Awaiting Image" src="" style="width: 100%; max-width: 219px; height:auto; horizontal-align: center;" /></a></p>
<p> </p>
<p><strong><span style="color:#89A6A1;">Category</span></strong></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
【问题讨论】:
标签: html