Tutorial 6 - Floating inline list items

Step 10 - Add a rollover color

Use the "a:hover" to set a second background color, as a rollover state. If you roll over the list now you will see that the rollover works.

Go to Step 11 →



CSS CODE
ul#navlist
{
padding: 0;
margin: 0;
list-style-type: none;
}

ul#navlist li { display: inline; }

ul#navlist li a
{
float: left;
width: 5em;
color: #fff;
background-color: #036;
padding: 0.2em 1em;
text-decoration: none;
border-right: 1px solid #fff;
}

ul#navlist li a:hover
{
background-color: #369;
color: #fff;
}


HTML CODE
<ul id="navlist">
<li><a href="#">Item one</a></li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
</ul>
Other Max Design articles and presentations
Associated with webstandardsgroup.org