May 14, 2003 · Dan Cederholm

Styling the number of an ordered list

I'm sure it's possible, isn't it? I've searched high and low and can't seem to figure out if it can be done. Should be simple -- and I'm hoping it is: Can the number that is generated by an ordered list be styled seperately from what is contained within the li tag with CSS?

For instance, I'd like to bold the number, but not what's in the li. Giving font-weight: bold to the ol doesn't do it. And giving font-weight: bold to the li tag just bolds the whole thing. I realize I could add a span in there, but that seems uneccesary.

Seems like a completely logical thing to do -- give the number special treatment like bold or a different color or font size.

I'm waiting for someone to make me feel stupid. And hoping...