While working with asp.net4.0, I am attempting to create a menu bar using CSS. Everything seems to be working fine except for the 'active' code, which doesn't seem to be responding as expected. Any insights into why this might be happening?
CSS Code
#main-nav{
height:29px;
float:left;
background-image:url(images/nav-bg.gif);
background-repeat:repeat-x;
background-position:top left;
width:100%;
}
#main-nav ul,
#main-nav li{
padding:0px;
margin:0px;
list-style-type:none;
}
#main-nav ul{
height:29px;
line-height:29px;
background-image:url(images/nav-bar.gif);
background-position:right;
background-repeat:no-repeat;
float:left;
padding:0px 1px 0px 0px;
margin:0px 0px 0px 10px;
}
#main-nav li{
height:29px;
line-height:29px;
display:inline;
position:relative;
float:left;
width:80px;
text-align:center;
}
#main-nav li a{
height:29px;
width:80px;
text-align:center;
float:left;
background-image:url(images/nav-bar.gif);
background-position:left;
background-repeat:no-repeat;
}
#main-nav li a:link,
#main-nav li a:visited{
color:#FFFFFF;
text-decoration:none;
}
#main-nav li active{
background-image:url(images/active.gif);
background-repeat:no-repeat;
background-position:left;
}
#main-nav li a:hover{
background-image:url(images/active.gif);
background-repeat:no-repeat;
background-position:left;
}
Updated CSS file
#main-nav{
height:29px;
float:left;
background-image:url(images/nav-bg.gif);
background-repeat:repeat-x;
background-position:top left;
width:100%;
}
#main-nav ul,
#main-nav li{
padding:0px;
margin:0px;
list-style-type:none;
}
#main-nav ul{
height:29px;
line-height:29px;
background-image:url(images/nav-bar.gif);
background-position:right;
background-repeat:no-repeat;
float:left;
padding:0px 1px 0px 0px;
margin:0px 0px 0px 10px;
}
#main-nav li{
height:29px;
line-height:29px;
display:inline;
position:relative;
float:left;
width:80px;
text-align:center;
}
#main-nav li a{
height:29px;
width:80px;
text-align:center;
float:left;
background-image:url(images/nav-bar.gif);
background-position:left;
background-repeat:no-repeat;
}
#main-nav li a:link,
#main-nav li a:visited{
color:#FFFFFF;
text-decoration:none;
}
#main-nav li a:active ,#main-nav li a:focus
{
color:Aqua;
background-image:url(images/active.gif);
background-repeat:no-repeat;
background-position:left;
}
#main-nav li a:hover{
background-image:url(images/active.gif);
background-repeat:no-repeat;
background-position:left;
}