tags:

views:

44

answers:

2

How to make css active color be greeen when the hyperlink is clicked.

i tried the below code but it does work

Note that LeftNavBG_2 is a green image

a:active.leftMenu { /* Left Menu */
 font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
 font-size: 14px;
 color: #000;
 text-decoration: none;
 width: 144px;
 margin-bottom: 5px;
 display: block;
 max-width: 144px !important;
 vertical-align: bottom;
 padding-top: 5px;
 padding-bottom: 5px;
 background-image: url(../images/LeftNavBG_2.gif);

}
+2  A: 

You should indicate your class before the pseudo-selector. Try a.leftMenu:active rather than a:active.leftMenu.

Bauer
A: 

Make it green when the user clicks the link (mouse down):

a.leftMenu:active, a.leftMenu:focus
{
   /*your css here*/
}

Make it green when the user visited, clicked, the link:

a.leftMenu:visited
{
   /*your css here*/
}
Joop
Thanks it is working now.