Forum Moderators: not2easy

Message Too Old, No Replies

Text Decoration not effecting list items

         

newdude

4:04 pm on Jun 26, 2009 (gmt 0)

10+ Year Member



i'm currently building this site: <snip> and for some reason the text decorations (colors and no-underline) that i have applied to the items in my left hand nav bar aren't being applied. what's weird is everything in the "#left_nav li" css is getting applied, but nothing in the "#left_nav_text li a:link" is getting applied.

thanks in advance!

#left_nav li {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
}
#left_nav_text li a:link {
text-decoration: none;
list-style-type: none;
color: #FF0000;
}

<div id="left_nav">
<p><img src="practice.jpg"></p>
<ul>
<li><a href="#">specifics removed</a></li>
<li><a href="#">specifics removed</a></li>
<li><a href="#">specifics removed</a></li>
<li><a href="#">specifics removed</a></li>
</ul>

<p><img src="learning.jpg"></p>
<ul>
<li><a href="#">specifics removed</a></li>
<li><a href="#">specifics removed</a></li>
<li><a href="#">specifics removed</a></li>
<li><a href="#">specifics removed</a></li>
</ul>
<p>&nbsp;</p>
</div><!-- end left_nav div-->

[edited by: newdude at 4:22 pm (utc) on June 26, 2009]

[edited by: swa66 at 7:54 pm (utc) on June 26, 2009]
[edit reason] No personal links allowed, please see ToS and forum charter, also specifics removed [/edit]

jameshopkins

4:12 pm on Jun 26, 2009 (gmt 0)

10+ Year Member



I don't see an element with an ID of 'left_nav_text' on your page. I do however, see an element with an ID 'left_nav'.

swa66

8:23 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aside of the problem noted above, you probably have visited those links already ...

It's probably better to style the "a" element instead of the "a:link" pseudo class.
You can then still style :link :visited :hover, etc. as you like (e.g. to change the colors in those states) without needing to repeat things that stay the same.

Also: an <a> not being a list, it doesn't need "list-style-type: none;", it would probably be a bit more effective on the <ul>.

newdude

9:08 pm on Jun 26, 2009 (gmt 0)

10+ Year Member



that worked. thanks for the help!

TenTonJim

1:31 am on Jun 27, 2009 (gmt 0)

10+ Year Member



also just an aside, you may want to use dashes instead of underscores in your declarations:
'left-nav-text'
instead of
'left_nav_text'

I cannot remember specifically but do recall some funky/unpredictable behavior in IE at some point when using underscores.