Previous Message
Next Message

Inheriting color and decoration in nested lists

Sent by Eric A. Meyer on 4 November 2003 23:11


At 15:58 -0600 11/4/03, Chet wrote:

>It's less than perfectly elegant, but it does produce ALMOST the 
>desired behavior. If I have:
>
><ol class="prog">
><li>item</li>
><li class="done">completed item</li>
>	<ol >
>	<li>subitem 1</li>
>	<li>subitem 2</li>
>	</ol>
></ol>

    Fixing your markup should get your desired behavior with the 
original styles you wrote.  Nested lists go inside <li> elements, not 
outside them, as an HTML validator would have quickly told you.  Thus:

<ol class="prog">
<li>item</li>
<li class="done">completed item
	<ol >
	<li>subitem 1</li>
	<li>subitem 2</li>
	</ol>
</li>
</ol>

If you have:

..done {
	color: black;
	text-decoration: line-through;
	}

....then the whole sublist will be black and stricken, or at least should be.
    Validate, validate, validate...

-- 
Eric A. Meyer (http://www.meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff (http://www.mako4css.com/)
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: