• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 67
  • Last Modified:

CSS anchor colors do not seem to be affected the link

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.
0
Howard Bash
Asked:
Howard Bash
  • 2
1 Solution
 
Kim WalkerWeb Programmer/TechnicianCommented:
You may have a more specific style that is taking precedence. Can you post a link to the live page?
0
 
Jason CarsonFreelance Computer TechnicianCommented:
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.
0
 
Howard BashSenior Software EngineerAuthor Commented:
Hi,

I added the !important and it works.  Not sure what is colliding with it.  But that works for me.  Thank you sir.
0
 
Howard BashSenior Software EngineerAuthor Commented:
Worked as required.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now