.thumbnail:hover
{
background-color: transparent;
z-index: 1;
}
我已經指定了這種樣式來使圖像在鼠標懸停時與另一圖像重疊。除了IE8以外,它可以在所有其他瀏覽器中正常工作。我試着爲z-index指定更高的值,但它沒有奏效!z-index屬性在IE8中不會導致重疊
這是縮略圖
.thumbnail {
position: relative;
z-index: 0;
}
.thumbnail:hover {
background-color: transparent;
z-index: 50;
}
.thumbnail span {
position: absolute;
background-color: lightyellow;
padding: 5px;
right: -500px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}
.thumbnail span img {
border-width: 0;
padding: 2px;
width: 400px;
height: 300px;
}
.thumbnail:hover span {
visibility: visible;
top: 0;
right: -290px;
vertical-align: top;}
The HTML part for the CSS is mentioned below : <a id="aPhotos" href="SubscribersPropertyDetail.aspx" class="thumbnail" runat="server"> <img id="imgPhotos" border="0" height='130' width='150' title='Click to view full details about this property' runat="server" /> <span id="spanZoom" runat="server"> <img id="imgzoomphotos" src='~/images/PropertyImages/NoImage.jpg' runat="server" /></span> </a>
我已經嘗試將位置更改爲相對和絕對,但都沒有按預期工作! – banupriya 2010-09-17 07:48:51
是否嘗試爲.thumbnail的父級設置位置和z-index值?請參閱下面的答案。在IE中,你需要開始一個新的堆棧。如果你粘貼一段html,我肯定有人可以爲你設置一個工作示例 – lnrbob 2010-09-17 08:05:15
ASP.Net中的CSS書寫器的HTML部分如下所示:
–
banupriya
2010-09-17 09:13:15