Solved

Change hyperlink color in a layer (CSS)

Posted on 2007-04-10
2
736 Views
Last Modified: 2013-11-19
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:

.recuadro{
      background-image:url(images/back_recuadro.jpg);
      background-position:top;
      background-repeat:repeat-x;
      min-height:50px;      
      width:100%;

}

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!

      
0
Comment
Question by:arthurh88
2 Comments
 
LVL 30

Accepted Solution

by:
VirusMinus earned 500 total points
ID: 18886447
just create new styles as follows:

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

etc.

that will apply to links inside any div with the recuadro class
0
 
LVL 4

Expert Comment

by:biXen
ID: 18888156
You can also write it like this:

.recuadro a, .recuadro a:link, .recuadro a:visited, .recuadro a:active{
color: #555555;
}
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

839 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