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

}

Answers


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


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

Need Your Help

How to create dependency injection for testing QTcpSocket?

c++ qt dependency-injection qtestlib

I'm trying to write unit tests for a Qt5 application that I wrote, but I'm stumped about how to handle the classes that involve networking. My main class includes a QTcpServer subclass, which over...

npm run-script myScript arguments

node.js npm

According to the website https://docs.npmjs.com/cli/run-script