FYI, I rather to have had a code that got the job done in CSS code
only and did not need alteration to the HTML since there so are many
OL instances in the pages.
But if that is not possible, then this will have to do.
There’s no CSS-only way to do it. You could, however, use Javascript to insert the <span> items for you. That would only require modifying the header, and not the content itself.
I see.
I am weary of Javascript since it behaves too differently across browsers,
specially across MaC. So I guess I will stay with the CSS/PHP solution.
There is a way to do it with CSS only, but it’s only supported by modern browsers and it’s not easy to achieve the right styling in Firefox since it’s very limited in what you can do with generated content.
The following works decently in Opera, Firefox 3, Safari and Chrome. It won’t work in IE7 or older, and I don’t have access to IE8 for testing.