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

Change hyperlink color in a layer (CSS)

probably a basic question, but in my CSS i have this:

a:link            { color: navy; }
      a:visited       { color: navy; }
      a:hover            { color: whitesmoke; background-color: #474B39;}
      a:active       { color: #FFFFFF;  }
which works great to set the default on my page.  But there is one div layer in my document that I want my hyperlinks to be a different color than the default.  My CSS for that section reads:



what do I need to add to make hyperlinks in that area a different color than the default?   My page is xhtml 1.1 strict.   TY!

1 Solution
just create new styles as follows:

.recuadro a:link{}
.recuadro a:visisted{}


that will apply to links inside any div with the recuadro class
You can also write it like this:

.recuadro a, .recuadro a:link, .recuadro a:visited, .recuadro a:active{
color: #555555;
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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