On 3/12/07, Barney Carroll <[EMAIL PROTECTED]> wrote:
> So if I were to have a list of black text with red numeric markers,
> would I be forced to create a span within each li, then set the li's
> colour to red and the span back to black?

Here it is with pure CSS. It works in FF 2 and Opera 9 on Ubuntu, and
presumably on other platforms. A minor, non-standards compliant
browser doesn't work with the style sheet, so we send it something
more palatable via conditional comments.

--Chris

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<style>
ol {
 counter-reset: list;
 list-style-type: none;
}

li:before {
 content: counter(list) ". ";
 counter-increment: list;
 color: #F00; /* and/or other styling... */
}
</style>

<!--[if IE]>
<style>
ol {
 list-style-type: decimal;
}
</style>
<![endif]-->

</head>
<body><ol>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ol>
</body>
</html>
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to