I added a hover effect on my links. So you when you hover on a link it will change color. I want the hover effect color to stay the same when clicked on. I know this question sounds really confusing and you probably have no idea what I am talking about but I hope you can help me

1 answer

4
points

Just remember LoVe comes before HAte. LVHA:

a:link    {color: #000000;}
a:visited {color: #008000;}
a:hover   {color: #FF0000;}
a:active  {color: #0000FF;}

Link is the color before it's clicked on. Visited is the color it will be when you return to that page after the link has been visited. Hover is the color when the mouse is over it. Active is the color when it's clicked.

They work best when defined in the LVHA order; there are exceptions if you want to research it.

Credit where credit is due; I think Eric Meyer came up with the Love-Hate mnemonic.

Answered over 6 years ago by Mike Combs