[thelist] Separate text node from containing element using JS?

Erik Mattheis gozz at gozz.com
Mon Mar 12 12:03:15 CDT 2007


You may want to try,

ol li { color: yellow;}
ol li span { color: red;}
ul li { color: green;}
ul li span { color: blue;}


-----Original Message-----
CSS doesn't cater for list marker color properties, there is only LI to 
define at best. A simple solution would involve something like this:

<ol>
<li><span>Preface</span></li>
<li><span>Introduction</span></li>
<li><span>Chapter 1</span></li>
</ol>

li{color:red;}
li span{color:black;}


... Use of 
list-style-image and adjacent selectors is also out because my user base 
is on IE (as ever).

So I was wondering if I could keep the rules for OL or LI with the 
desired marker colour, and then somehow style just the text node within.





More information about the thelist mailing list