W3C home > Mailing lists > Public > www-style@w3.org > February 2003

Re: inline display of list-item?

From: David Dorward <david@us-lot.org>
Date: Fri, 21 Feb 2003 23:26:38 +0000
To: Kang Jeong-Hee <Keizi@mail.co.kr>
Cc: www-style@w3.org
Message-ID: <20030221232638.GA4592@us-lot.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:19 GMT