On Thu, 29 Jul 2004 01:24:31 GMT, "dp" <no*********@hotmail.com>
wrote:
"Claire Tucker" <fa**@invalid.invalid> wrote in message
news:mj********************************@4ax.com.. .
In a CSS2-supporting browser, the bullet may be in the :before box of
the list item, so changing the color of this may work:
li:before {
color: pink;
}
Tried with latest versions of IE, Mozilla, Firefox and Opera, but no joy.
It looks like Mozilla Seamonkey (and Firefox) specify the default
rendering for lists using CSS1 list properties rather than CSS2
markers as I first assumed. (see res/html.css in the FireFox/Seamonkey
directory to see how Mozilla implements the rendering of each element.
Some of them are quite interesting...)
You could, theoretically, disable the CSS1 list properties and use
CSS2 markers instead, but in my testing I was left unsure of whether
Opera and Firefox were actually respecting the marker properties or if
they were just ignoring it and making regular generated content:
ul {
list-style: none;
}
ul li:before {
display: marker;
content: "\2022 ";
color: #0000ff;
}
Since IE doesn't support generated content or :before, it'll render
this without any bullets at all. You may like to "hide" the first rule
from IE by using a child selector, which IE doesn't support and will
thus skip:
body > ul {
list-style: none;
}
This will make the lists appear with non-special bullets in IE, but
your colored bullets will now, of course, only work right if the list
is a direct child of the BODY element.
Also, exploiting a browser's lack of support of something to hide
things from it is a risky business for a number of reasons, most
notably because a future version of IE might support child selectors
but not generated content, or vice-versa. In the latter case, you
might end up with two sets of bullets! That's not to mention that
there might already be a browser out there in the wild which supports
generated content but not child selectors. Beware.
Best of luck,
-Claire