coothead
09-02-2004, 05:08 PM
Hi there folks,
here is another example of the 'css' rollover that you might find interesting.
It uses a single image like this...
http://www.coothead.co.uk/images/single_image_rollover.gif
...instead of two.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>CSS single image rollover</title>
<style type="text/css">
body {
background:#999;
}
#image {
display:block;
width:100px;
height:99px;
border:inset 8px #888;
margin:200px auto 0;
background:url(http://www.coothead.co.uk/images/single_image_rollover.gif) 0 0 no-repeat;
text-align:center;
font-family:arial,sans-serif;
font-size:1.1em;
color:#fa3999;
line-height:99px;
text-decoration:none;
}
#image:hover {
background-position:-100px 0;
color:#39fa99;
}
</style>
</head>
<body>
<div>
<a id="image" href="#">css rollover</a>
</div>
</body>
</html>
here is another example of the 'css' rollover that you might find interesting.
It uses a single image like this...
http://www.coothead.co.uk/images/single_image_rollover.gif
...instead of two.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>CSS single image rollover</title>
<style type="text/css">
body {
background:#999;
}
#image {
display:block;
width:100px;
height:99px;
border:inset 8px #888;
margin:200px auto 0;
background:url(http://www.coothead.co.uk/images/single_image_rollover.gif) 0 0 no-repeat;
text-align:center;
font-family:arial,sans-serif;
font-size:1.1em;
color:#fa3999;
line-height:99px;
text-decoration:none;
}
#image:hover {
background-position:-100px 0;
color:#39fa99;
}
</style>
</head>
<body>
<div>
<a id="image" href="#">css rollover</a>
</div>
</body>
</html>