Forum Moderators: not2easy
I purchased a book on css and do have a better understanding of css now, but I still can't figure this out.....
I have built a css page and it looks fine in IE6....What I want to do is have a small icon/image to show up on the list links at hover. I would like the text to stay the same, just have the small image/icon show up to the left side of the link on hover.
I am not looking for someone to do this for me, just an example or reference if it can be done.
Thanks for any advice or help.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
body{
font: 80%/1.7 Tahoma, Verdana, sans-serif;
}
*{ /*This sets all padding and margins to zero. It's not strictly necessary, but you WILL have to set all the applicable margins and padding on the <ul> and <li>s to zero*/
margin:0;
padding:0;
}
#nav{
width:100px;
background:#789;
}
ul{
list-style-type:none;
}
ul li{
display:inline; /*Fixes the IE Whitespace in Lists bug*/
}
ul li a{
display:block;
padding-left:25px; /*WIDTH OF IMAGE - clears space for the image to show*/
color:#fff;
text-decoration:none;
}
ul li a:link, ul li a:visited{
background: none;
}
ul li a:link:hover, ul li a:visited:hover{
background: url(images/arrow.gif) no-repeat left center;
}</style>
</head>
<body>
<div id="nav">
<ul>
<li><a href="#">Item1</a></li>
<li><a href="#">Item2</a></li>
<li><a href="#">Item3</a></li>
<li><a href="#">Item4</a></li>
</ul>
</div>
</body>
</html>
cEM