Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CSS anchor colors do not seem to be affected the link

Posted on 2016-09-30
4
Medium Priority
?
63 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 8

Accepted Solution

by:
Jason earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
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 style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

721 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