Jump to content

Images


_tina_

Recommended Posts

(X)HTML:

<div id="container">
<div id="display"></div>
</div>

 

CSS:

#container
{
height:20px; // height of tiny.png
width:20px; // width of tiny.png
background:url(tiny.png) no-repeat left top;
position:relative;
}

#display
{
height:35px; // height of big.png
width:35px; //width of big.png
display:none;
background:url(big.png) no-repeat left top;
position:absolute;
top:-7px; // half the difference of the heights of the two images ((35px - 20px) / 2) = 7.5px
left:-7px; // half the difference of the widths of the two images ((35px - 20px) / 2) = 7.5px
}

#container:hover #display
{
display:block;
}

Link to comment
https://forums.phpfreaks.com/topic/176211-images/#findComment-928848
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.