Welcome to WebmasterWorld Guest from 50.16.78.128

Forum Moderators: incrediBILL

Message Too Old, No Replies

unordered list with bullets a different color from text

   
8:24 pm on Jul 16, 2002 (gmt 0)

10+ Year Member



Hi everyone;
Just wondering if anyone knew how to make the
bullet in an unordered list a different color than
the text.

thanks,
TheebaLinda

8:46 pm on Jul 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<ul style="list-style-image:url(green.gif);"> 
<li>first item</li>
<li>second item</li>
<li>etc...</li>
</ul>

Obvously, you can change more than just the color that way... ;)

9:37 pm on Jul 16, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Just one caution, those image bullets won't scale with different font sizes like the default font bullets do (which is obvious once you think about it).

I think you can also define the ul style and then put a span around the text in each <li></li> to change the font color. This would give you scalable bullets.

9:46 pm on Jul 16, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



It works:

<ul style="color:blue">
<li><span style="color:red">One</span></li>
<li><span style="color:green">Two</span></li>
<li><span style="color:violet">Three</span></li>
</ul>

10:02 pm on Jul 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Heh, now you inspired me to more experiments:

<ul>
<li style="color: green;"><span style="color: pink;">eins</span></li>
<li style="color: blue;"><span style="color: orange;">zwei</span></li>
<li style="color: red;"><span style="color: black;">drei</span></li>
</ul>

It may not be pretty, but it sure is colorful... ;)

10:21 pm on Jul 16, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You never can tell when those little flashes of brilliance will come in handy.
4:17 pm on Jul 17, 2002 (gmt 0)

10+ Year Member



Thanks so much;

exactly what I needed : )