CSS anchor colors do not seem to be affected the link

Howard Bash
Howard Bash used Ask the Experts™
on
I had this question after viewing The Menu is good, but needs a couple of Tweaks.

I added these two CSS rules:

.sub-menu-item > a:hover {
      color:red;
}

.sub-menu-item > a:link {
      color:black;
}

The color of the link does indeed show the text black,  but on hovering,  the color of the text doesn't change to red.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Kim WalkerWeb Programmer/Technician

Commented:
You may have a more specific style that is taking precedence. Can you post a link to the live page?
Computer Technician
Top Expert 2015
Commented:
You can try this...
.sub-menu-item > a:hover {
      color:red !important;
}

Open in new window

The !important means it will override any style that has precedence and use this rule instead, but it would help to have a link to the website so we can see all the code.
Howard BashSenior Software Engineer

Author

Commented:
Hi,

I added the !important and it works.  Not sure what is colliding with it.  But that works for me.  Thank you sir.
Howard BashSenior Software Engineer

Author

Commented:
Worked as required.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial