Here's one way:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.rollimage1 {
display:block;
width:70px;
height:113px;
background-image:url('image1.gif');
}
.rollimage1:hover {
background-image:url('over1.gif');
}
</style>
</head>
<body>
<a class="rollimage1" href="javascript:void(0);" onclick="return false;"></a>
</body>
</html>
Notes: If you want the rollover to be linked, you can forget about the javascript:void(0); and remove the onclick event (the two of which together degrade gracefully in most non-javascript enabled browsers) and just give the href attribute the URL for the link. Because IE does not apply the hover pseudo class except to anchor links, this syntax (or one much like it) pretty much must be used. Browsers require display:block; to render properly. If you want the images to appear to be inline, floating, positioning or the use of a table would be required. The width and height should be that of the images. Two images of the same dimensions should be used but, with a little creativity that can be worked around.
This sort of effect can be more conveniently accomplished with active javascript but, that leaves out non-javascript enabled browsers.
Bookmarks