我在表格中创建了缩略图和说明字段。缩略图具有覆盖相邻文本但不包含相邻缩略图的跨度图像? (所有都包含在#divSparesItem中)我试着在其他讨论中建议添加z-index并向css显示变体,但没有任何东西可以解决问题。谁能帮忙?跨度图像叠加文本但不包含其他图像
HTML:
<table>
<tr>
<td><a class="thumbnail" href="#thumb"><img src="Design/Spares Image Thumbnail.png" width="80" height="60" alt="Spare I"/><span><img src="Design/Spares Image Large.png" width="320" height="240" alt="Spare I"/><br/>Spare I</span></a><p>CODE: 123ABC<br/>Description: Donec egestas justo ut nulla congue bibendum.<br/><font color="#FF0000">Price</font></p></td>
<td><a class="thumbnail" href="#thumb"><img src="Design/Spares Image Thumbnail.png" width="80" height="60" alt="Spare I"/><span><img src="Design/Spares Image Large.png" width="320" height="240" alt="Spare II"/><br/>Spare II</span></a><p>CODE: 123ABC<br/>Description: Donec egestas justo ut nulla congue bibendum.<br/><font color="#FF0000">Price</font></p></td>
<td><a class="thumbnail" href="#thumb"><img src="Design/Spares Image Thumbnail.png" width="80" height="60" alt="Spare III"/><span><img src="Design/Spares Image Large.png" width="320" height="240" alt="Spare I"/><br/>Spare III</span></a><p>CODE: 123ABC<br/>Description: Donec egestas justo ut nulla congue bibendum.<br/><font color="#FF0000">Price</font></p></td>
</tr>
</table>
CSS:
#divSparesItem {
color:#CCC;
text-align:left;
font-size:0.8em;
float:right;
padding-top:10px;
padding-left:25px;
padding-right:25px;
text-decoration:none;
}
#divSparesItem img {
float:left;
margin-top:2px;
margin-right:15px;
margin-bottom:10px;
border-left:#000;
border-top:#000;
border-right:#999;
border-bottom:#999;
border-width:1px;
border-style:solid;
}
.thumbnail {
position:relative;
z-index:0;
}
.thumbnail span{
position:absolute;
background-color:#333;
padding-top:15px;
padding-left:15px;
padding-right:0px;
padding-bottom:15px;
border-left:#999;
border-top:#999;
border-right:#000;
border-bottom:#000;
border-width:1px;
border-style:solid;
visibility:hidden;
color:#CCC;
text-decoration:none;
}
.thumbnail span img{
border:none;
z-index:100;
}
.thumbnail:hover span{
display:block;
visibility:visible;
background-color:#333;
top:-115px;
left:0;
}
你可以看到问题here(点击Benelli1选项卡上)。任何意见将不胜感激!
你不应该真的在这个布局中使用表格 - 你应该简单地使用DIV等标签。 HTML表格实际上只是为了显示表格数据。 –