lAZLf Posted December 27, 2009 Share Posted December 27, 2009 I wanted everyone to know that there is a better alternative to JavaScript rollover images that uses simple CSS. HTML: <div class="rolloverdiv"> <a href="#" class="rolloverimg"></a> </div> the CSS: .rolloverdiv { height:150px; width: 150px; } .rolloverimg { background: url(imgname.extension); width:100%; height:100%; display:block; cursor: pointer; } .rolloverimg:hover { background: url(secondimgname.extension); } This should be a healthier, simpler alternative to JavaScript rollover images. Link to comment https://forums.phpfreaks.com/topic/186461-a-better-more-flexible-alternative-to-javascript-rollover-images/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.