user297211
user297211

Reputation:

Css active isse:not working

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);

}

Upvotes: 0

Views: 415

Answers (2)

Joop
Joop

Reputation: 2839

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*/
}

Upvotes: 0

gpmcadam
gpmcadam

Reputation: 6580

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

Upvotes: 2

Related Questions