Solved

CSS anchor colors do not seem to be affected the link

Posted on 2016-09-30
4
36 Views
Last Modified: 2016-09-30
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
Comment
Question by:Howard Bash
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41824260
You may have a more specific style that is taking precedence. Can you post a link to the live page?
0
 
LVL 7

Accepted Solution

by:
Jason earned 500 total points
ID: 41824307
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
 
LVL 1

Author Comment

by:Howard Bash
ID: 41824366
Hi,

I added the !important and it works.  Not sure what is colliding with it.  But that works for me.  Thank you sir.
0
 
LVL 1

Author Closing Comment

by:Howard Bash
ID: 41824367
Worked as required.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now