Forum Moderators: not2easy

Message Too Old, No Replies

Change link text color only inside a div?

Syntax to change "a:link" only temporarily?

         

JayCee

6:23 pm on Jan 19, 2007 (gmt 0)

10+ Year Member



I have a div like so:

#leftPolicyBox1 {
margin: 7px 10px 5px 10px;
border: 1px solid #000000;
background-color: #44618C;
font-size: 10px;
}

I need to add something like:


a:link, a:visited, a:hover {
color: #DDDDDD;
text-decoration: none;
}

to that first div, such that the link text color on the page is only affected inside that div.
What syntax makes the a:link, etc. local to the div, rather than affecting the whole page?

Fotiman

7:22 pm on Jan 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just include the ID in the selector (make sure you do it for each comma separated value).


#leftPolicyBox1 a:link,
#leftPolicyBox1 a:visited,
#leftPolicyBox1 a:hover {
color: #DDDDDD;
text-decoration: none;
}

JayCee

10:35 pm on Jan 19, 2007 (gmt 0)

10+ Year Member



Works great Fotiman.

Thanks very much!

[edited by: JayCee at 10:36 pm (utc) on Jan. 19, 2007]