Previous Message
Next Message

Text Decoration Problem

Sent by Scott Taylor on 26 July 2005 15:03


Philippe Wittenbergh wrote:

>
> On 26 Jul 2005, at 6:28 am, Scott Taylor wrote:
>
>> #right_nav ul li {
>>    text-decoration: underline;
>> }
>>
>> #right_nav ul li ul li {
>>    text-decoration: none;
>> }
>>
>> In Firefox, all li elements, including the second ordered list, 
>> become underlined.  In IE 6., only the first ordered list elements 
>> become underlined (as I would like them to be).
>>
>> How can I fix this?  What am I doing wrong?
>>
>>
>> Here is the HTML: 
>> http://www.miningstocks.com/testing_server/newindex2.php
>
>
> The second level list-items are still wrapped within the parent li. 
> The text-decoration you see in good browsers like Opera, Firefox, 
> Safari and IE Mac is the text-decoration applied to the top level <li>.
>
> very much simplified, you have this
> <div> some text <span> some other text</span> and yet some more 
> text</div>
> div {text-decoration:underline; color black}
> span {text-decoration:none; color:red;}
> The span will still have a black coloured text-decoration.
>
> You gonna have to wrap the text-node of the toplevel <li> in a span, 
> and style that.
> <li><span>text</span>
>     <ul><li>text</li></li></ul>
> </li>
>
> Philippe
> ---
> Philippe Wittenbergh
> <http://emps.l-c-n.com/>
>

Thank you for your simple explanation and solution.

I figured as much (for the solution), but it sort of seems backwards to 
me.  CSS always has - I guess thats why I'm on the newbie mailing list.

Two questions arise from this:
1.  Why can I specify the color of fonts to be different in these two 
different situations (or various other properties), but I can't specify 
if the text is underlined?
2.  Why would the most general rule (the one concerning the top level 
li's) be applied last (or always)?  This is what seems backwards to me.  
The most general rules should be applied first, and then specific rules 
should be able to modify those general rules.  But then again, I guess 
that is what the span's are doing.
3.  Would this mean that if I had:
   
        A:link { text-decoration: none}

that this could not ever be changed?  Or is simply about it being inside 
the <div>?


Thank you again,

Scott Taylor
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: