Creating Rollover Effect Using CSS List Menus
by Amrit HallanWednesday, 26th October 2005
<style>
body{
background-color: #FFFFFF;
font-family: Georgia, Verdana, Geneva, Arial, Helvetica, sans-serif;
}
#nav{
width: 150px;
}
#nav ul{
display: inline;
}
#nav ul li{
list-style-type: none;
line-height: 150%;
}
#nav ul li a{
color: #6495ED;
text-decoration: none;
border-bottom: #6495ED 1px dotted;
}
#nav ul li a:hover{
color: #DC143C;
text-decoration: none;
border-bottom: #DC143C 1px solid;
}
</style>
This sort of rollover simply changes the color or the look of the underline.
<style>
body{
background-color: #FFFFFF;
font-family: Georgia, Verdana, Geneva, Arial, Helvetica, sans-serif;
}
#nav{
width: 150px;
}
#nav ul{
display: inline;
}
#nav ul li{
list-style-type: none;
line-height: 150%;
border-left: #000000 8px solid;
border-top: #000000 1px solid;
border-bottom: #000000 1px solid;
border-right: #000000 1px solid;
background-color: #BDB76B;
margin-top: 5px;
}
#nav ul li a{
color: #000000;
text-decoration: none;
display: block;
padding-left: 10px;
padding-right: 10px;
}
#nav ul li a:hover{
color: #FFFFFF;
background-color: #4682B4;
text-decoration: none;
}
</style>
<div id="nav">
<ul>
<li><a href="#">This is link 1</a></li>
<li><a href="#">This is link 2</a></li>
<li><a href="#">This is link 3</a></li>
<li><a href="#">This is link 4</a></li>
</ul>
</div>
#nav{
width: 150px;
}
#nav ul{
display: inline;
}
#nav ul li{
list-style-type: none;
line-height: 150%;
border-left: #000000 8px solid;
border-top: #000000 1px solid;
border-bottom: #000000 1px solid;
border-right: #000000 1px solid;
background-color: #BDB76B;
margin-top: 5px;
}
padding-left: 10px;
padding-right: 10px;
Amrit Hallan is a freelance web developer. You can checkout his website at http://www.bytesworth.com. For more such articles join BYTESWORTH REACHOUT at http://www.bytesworth.com/br/default.asp or if you have a web dev related question then post it at http://www.business180.com/index.php