Easy way to have separate bullet and text color on List?

E

Eric Pinnell

Is there an easy way for me to set different colors for my text and
bullets in an unordered list? The only thing I can think of is to
define a style for UL that sets the foreground to one color, then on
the next line do a SPAN or something like that for the text whose
color has to be different.




Eric Pinnell

(Author, "Claws of The Dragon", "The Omega File")

For a preview, see: http://www.ericpinnell.com and click on "books"
 
R

Richard

Eric said:
Is there an easy way for me to set different colors for my text and
bullets in an unordered list? The only thing I can think of is to
define a style for UL that sets the foreground to one color, then on
the next line do a SPAN or something like that for the text whose
color has to be different.

Sure. Set up a different class for each color of text.
<ul class="red">
<ul class="blue">
<ul class="white">


Eric Pinnell
 
J

Jukka K. Korpela

Eric Pinnell said:
Is there an easy way for me to set different colors for my text and
bullets in an unordered list?

Create an image of a colored bullet and use list-style-image in CSS.
The only thing I can think of is to
define a style for UL that sets the foreground to one color, then on
the next line do a SPAN or something like that for the text whose
color has to be different.

Yes, that's the other alternative - I don't think there are other
possibilities. (The list bullet is conceptually part of the <li>
element, so the only way to make it have a color different from the
list item text is to wrap that text inside an auxiliary element.)
 
S

Steve Pugh

Correct, it's either that or using a graphic for the bullet (i.e.
list-style-image property).
Sure. Set up a different class for each color of text.
<ul class="red">
<ul class="blue">
<ul class="white">

And this makes the text a different colourt to the bullets how?

Steve
 
E

Eric Pinnell

Sure. Set up a different class for each color of text.
<ul class="red">
<ul class="blue">
<ul class="white">

That's not what I mean. What I want is to have the bullet be one
color and the text another color on the same line. If I have a link, I
can get away with it, since the link can be defined as a different
color than the foreground color used by the bullet. What happens,
though, if there's text instead of a link?


Eric Pinnell

(Author, "Claws of The Dragon", "The Omega File")

For a preview, see: http://www.ericpinnell.com and click on "books"
 
B

Barefoot Kid

"Eric Pinnell" <see my web site> wrote in message | Is there an easy way for me to set different colors for my text and
| bullets in an unordered list? The only thing I can think of is to
| define a style for UL that sets the foreground to one color, then on
| the next line do a SPAN or something like that for the text whose
| color has to be different.

have u tried using images as ur bullet points?

ul {
list-style-image: url(images/bullet.gif);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top