Re: RE: OL starting with zero

26.03.02 04:12:05, "Lindsay Evans" <lindsay@redsquare.com.au> wrote:

>> At 2:44 AM +0100 3/26/02, Christoph P?per wrote:
>> >  > Might I suggest an extra list-style-type, say "code"
>> >>  which is equivalent to "decimal" but starts with zero?
>> >
>> >You mean decimal-leading-zero?
>>
>> No, I think he means one where the first element is numbered
>> zero instead of one. E.g.:
>
>isn't this what counter-reset[1] is for?

Counters can be used for numbered lists, and they can be any integer, 
positive, negative or zero (and they are so in Opera, the only 
implementation of CSS counters I know of). But as others have said there 
isn't really a close mapping of counters and ordered list items.


There is a way to have a larger audience than Opera-only, and that is using 
the START and VALUE attributes in UL and LI respectively. I.e. 

<ol start="0">
  <li>I should be zero</li>
</ol>


They are admittedly deprecated in HTML 4.0 and upwards (ending up in the 
optional Legacy module for XHTML Modularization), but still supported. 
Furthermore signs are that these two attributes will be de-deprecated in 
XHTML 2.0 (or at least the VALUE attribute of LI, as strictly speaking START 
is redundant).

The attribute value data types are defined differently in (X)HTML and in 
CSS. Where CSS uses "integer", HTML uses "number". And number is SGML-ese 
for a sequence of digits [0-9]. This means you can have zero, but you can't 
have negative values, nor can you have rational numbers ("1.5").

I made some tests (attached) to see the current browser support. The value 
"0" is accepted by IE and Opera, but a little surprisingly not by Netscape 
(4 or 6). There may be a workaround, but I couldn't find any.


In a sense it isn't too surprising, as (in CSS-speak) a value of "0" only 
makes sense for list-style-type: decimal | decimal-leading-zero | disc | 
circle | square | none. How do you represent "0" in upper-roman or lower-
latin? (Note to the authors of CSS3: Lists [1], "underflow" should probably 
be mentioned just as "overflow" when it comes to alphabethical numbering 
schemes.)

[1] <http://www.w3.org/TR/css3-lists/>


Jonny Axelsson
Documentation,
Opera software

Received on Tuesday, 26 March 2002 13:29:16 UTC