Hey everybody,
I'm working with ordered lists and I was wondering if it's possible to make the numbers a certain color. I know you can just add color: #000; to the li in the CSS but that colors the numbers and the list content as well. I want it to just color the numbers. Is this possible? I've looked around and couldn't find anything so I'm guessing it's not but I thought I would ask here for a final confirmation.
Thanks for any help you guys can provide. Wrap the contents of the li in a span and give that a diferent color.
li {color:#red;}
li span {color:#black;}
<ol>
<li><span>contents</span></li>
</ol>The numbers in an ordered list automatically inherit the color attribute in the CSS for that list. You could put the text inside the list-item inside a span, and color the span, though.
**EDIT**
Oh damnit! Fang is too fast!Quoted from Fang's profile
Resistance is futile
Thanks much guys. Thats exactly what I needed.
I'm working with ordered lists and I was wondering if it's possible to make the numbers a certain color. I know you can just add color: #000; to the li in the CSS but that colors the numbers and the list content as well. I want it to just color the numbers. Is this possible? I've looked around and couldn't find anything so I'm guessing it's not but I thought I would ask here for a final confirmation.
Thanks for any help you guys can provide. Wrap the contents of the li in a span and give that a diferent color.
li {color:#red;}
li span {color:#black;}
<ol>
<li><span>contents</span></li>
</ol>The numbers in an ordered list automatically inherit the color attribute in the CSS for that list. You could put the text inside the list-item inside a span, and color the span, though.
**EDIT**
Oh damnit! Fang is too fast!Quoted from Fang's profile
Resistance is futile
Thanks much guys. Thats exactly what I needed.