Forum Moderators: not2easy

Message Too Old, No Replies

css a element within a div

         

macrost

7:13 pm on May 26, 2004 (gmt 0)

10+ Year Member



I am trying to style my a elements that are within a div. I am starting out very basic, just trying to get the darn thing working!

The div is around a table that contains the href's.
Ducking...

But seriously, wouldn't this work?


<div id="nav">
<table border="0" cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top"><img src="images/lsbstart.gif" alt=""/></td>
</tr>
<tr>
<td id="nav1" valign="bottom">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=";
:)">;)</a></td>
</tr>
</table>
</div>

css code:


a#nav{
color:#FFFFFF;
}

DrDoc

7:37 pm on May 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try
#nav a
instead ;)

In fact, I would recommend using the SelectORacle [penguin.theopalgroup.com] to better understand selectors.

Comparing these two selectors:

a#nav;
#nav a

...tells us:

Selector 1: a#nav

Selects any a element with an id attribute that equals nav.

Selector 2: #nav a

Selects any a element that is a descendant of any element with an id attribute that equals nav.

macrost

7:50 pm on May 26, 2004 (gmt 0)

10+ Year Member



Holy crap batman! DrDoc, thanks for the reference! I will slowly start to get into css-p once I master the beginnings regular css.
Thanks!