Re: inline display of list-item?

On Sat, Feb 22, 2003 at 08:02:35 +0900, Kang Jeong-Hee wrote:
> but we often write this type of list items;
>  a. ... and b. ..., c. ...
> and I think CSS spec does not support that.

I think the specification supports it, but browser support is rather
lacking.

As far as I can tell, this should do the trick:

ol { counter-reset: item; }
li { display: inline; }
li:before { content: '(' counter(item) ') ';  counter-increment: item ;}
li:after {   content: ',';}
li.last:before { content: 'and '; }
li.last:after { content: ''; }

Mozilla renders:

<ol>
<li>red</li>
<li>white</li>
<li class="last">blue</li>
</ol>

as

red, white, and blue

I'm not sure what happened to the counter part.

-- 

Received on Friday, 21 February 2003 18:26:09 UTC