Forum Moderators: not2easy

Message Too Old, No Replies

style A href inside nested divs

         

bobstar

9:11 pm on Nov 30, 2006 (gmt 0)

10+ Year Member



Hello

I need a little advice how to accomplish this... I've a couple of nested divs..

<div id="a"><a href="#">The first wave</a>
<div id="b">WebFoo...
<div id="c"><a href="#">Here we go</a>
</div>
</div>
</div>

I want only to style the anchor 'Here we go'

But how? I've tried:
c.A:link {text-decoration: none}
c.A:visited {text-decoration: none}
c.A:active {text-decoration: none}
c.A:hover {text-decoration: none; background-color:yellow;color:blue}

with no luck :-¦

sldesigns

9:25 pm on Nov 30, 2006 (gmt 0)

10+ Year Member



In the css, the div id should have a # in front of it. I don't know if the uppercase a is hurting so I'd change to lowercase

#c a:link {text-decoration: none}
#c a:visited {text-decoration: none}
#c a:active {text-decoration: none}
#c a:hover {text-decoration: none; background-color:yellow;color:blue}

swa66

9:49 pm on Nov 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually I'd use:

#c a {text-decoration: none}
#c a:hover {background-color:yellow;color:blue}

It's a bit less to type and transmit.

Fotiman

9:51 pm on Nov 30, 2006 (gmt 0)

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



Also, the order of the link psuedo classes is very important. It should be:

:link
:visited
:hover
:active

A good way to remember it is "lovehate":

link
o
visited
e
hover
active
t
e

bobstar

11:38 pm on Dec 6, 2006 (gmt 0)

10+ Year Member



Very nice
Thank you...