Forum Moderators: not2easy

Message Too Old, No Replies

highlighting active link

         

cjkeane

6:59 am on Apr 17, 2010 (gmt 0)

10+ Year Member



i am using the following css on my site, but i need the active link/page to remain highlighted. i'm not sure what i'm doing wrong. any help would be appreciated.

#nav {
padding: 0px;
width: 515px;
margin:0px auto;
}

#mainnav {
margin: 0px;
padding: 0px;
list-style-image: none;
list-style-type: none;
}

#mainnav li {
padding: 0px;
float: left;
margin:0px 3px 0px 0px;
}

#mainnav li a:link, #mainnav li a:visited, #mainnav li a:active {
color: #333;
text-decoration: none;
margin: 0px;
display: block;
float: left;
border-bottom:solid 5px #dadada;
padding: 0px;
width: 100px;
height: 20px;
text-align: center;
}

#mainnav li a:hover {
text-decoration: none;
border-bottom:solid 5px #333;
}

#mainnav li a.active:link, #mainnav li a.active:visited, #mainnav li a.active:active, #mainnav li a.active:hover {
text-decoration: none;
border-bottom:solid 5px #990000;
}

rocknbil

6:51 pm on Apr 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard cjkeane, seems to be working fine in a validated document.

You're doing this, right?

<li><a href="link.html" class="active">Four</a></li>

Though I'd recommend against using any class or id name that may (or may not) conflict with reserved names, it appears to be working.