After successfully implementing rollover images, the code suddenly stopped working when I added a modal popup for another button on the site. I removed the modal pop-up, but now the sprites are broken. Instead of showing the light banner and dark hover effect, both sprite segments are displayed and scaled in. What could be causing this issue and how can it be resolved?
https://i.sstatic.net/YXEsf.jpg https://i.sstatic.net/RCPyD.png
a, img {
border: none;
outline: none;
}
a.rolla {
display: block;
width: 200 px;
height: 258px;
text-decoration: none;
background: url("https://i.sstatic.net/RCPyD.png");
background-size: 200px 258px;
background-repeat: no-repeat
}
a.rollb {
display: block;
width: 200 px;
height: 258px;
text-decoration: none;
background: url("https://i.sstatic.net/RCPyD.png");
background-size: 200px 258px;
background-repeat: no-repeat
}
a.rollc {
display: block;
width: 200 px;
height: 258px;
text-decoration: none;
background: url("https://i.sstatic.net/RCPyD.png");
background-size: 200px 258px;
background-repeat: no-repeat
}
a.rolld {
display: block;
width: 200 px;
height: 258px;
text-decoration: none;
background: url("https://i.sstatic.net/RCPyD.png");
background-size: 200px 258px;
background-repeat: no-repeat
}
a.rollover:hover, a.rollover2:hover, a.rollover3:hover {
background-position: -213px 0;
}
a.rolla:hover, a.rollb:hover, a.rollc:hover, a.rolld:hover {
background-position: -210px 0;
}
.displace {
position: absolute;
left: -5000px;
}
body {
background: url("rpt.png");
background-repeat: repeat;
width: 1024px;
margin: 0;
z-index: -1;
}
#banner {
z-index: 0;
}
#feTable {
z-index: 1;
position: absolute;
top: 455px;
left: 0;
}
<div width="1024px">
<img id="banner" src="banner.jpg" height="512 px" width="1024px">
<table id="feTable" style="width:1024px; left:22px">
<tr>
<td align="center" width="200px">
< a target="_parent" href="" class="rollb">< span class="displace"></a>
</td>
<td align="center" width="200px">
< a target="_parent" href="" class="rolla">< span class="displace"></a>
</td>
<td align="center" width="200px">
< a target="_parent" href="" class="rollc">< span class="displace"></a>
</td>
<td align="center" width="200px">
< a target="_parent" href="" class="rolld">< span class="displace"></a>
</td>
</tr>
</table>
</div>