I've created my navigation menu using CSS and an image sprite for the rollover states (i.e hover, active). However, I'm trying to create a 'selected/current' state (which in my case is the same as the active state) so that dependent on the page you've selected, the corresponding navigation button is highlighted. Here's what I have:
CSS:
#menu li {
margin: 0;
padding: 0;
height: 50px;
list-style: none;
display: inline;
float: left;
line-height: 40px;
}
#menu a {
display: block;
height: 50px;
}
#menu a:hover {
background-image:url(../Images/about_rollover.gif)
}
#about {
width: 90px;
}
#about a:hover {
background-position: 0 -50px;
}
#about a:active {
background-position: 0 -100px;
}
#about a:selected {
background-position: 0 -100px;
}
#portfolio {
width: 90px;
}
#portfolio a:hover {
background-position: 90px -50px;
}
#portfolio a:active {
background-position: 90px -100px;
HTML:
<ul id="menu">
<li id="about"><a href"#"></a></li>
<li id="portfolio"><a href="portfolio.html"></a></li>
</ul>
Image sprite: view here