tags:

views:

23

answers:

2

Building on the post I found at http://stackoverflow.com/questions/487528/ordered-lists-ol-starting-index-with-xhtml-strict, I was wondering if there is a way to define the start value of a list without using CSS and still be compliant conforming to the strict DTD specification? I am also looking for a solution of the "value" attribute assigned to the tag li.

Can I only start with a numerical value? Am I able to commence with a specific alphabet for example?

+2  A: 

It's deprecated but you can specify <ol start="5">, for instance. I'm not sure if you'll be able to pass strict standards using a deprecated attribute, though.

If you also use the type attribute to change the list type to say, roman or alphabetic, but when you specify start you would need to specify a number.

For a particular list item you can specify attributes of type and value, where value must be specified numerically but will be displayed in the appropriate type. These attributes, however, are also deprecated.

Other than these methods there are no other ways to specify the start without using at least a little CSS. You can put the CSS in a local style attribute if you're averse to dumping it in the header.

Mark E
why the heck would they deprecate that?
Mark
What do you mean by "local style" attribute? Do you mean inline style e.g. <p style="">
GTD
@GTD, Yes, inline style.
Mark E
A: 

correct way:

<ol>
    <li value='10'>item</li>
    <li>item</li>
    <li>item</li>
</ol>

correct, but deprecated

<ol start='20'>
    <li>item</li>
    <li>item</li>
    <li>item</li>
</ol>

ugly hack XD

<style>
    li.hidden { visibility: hidden; height: 0px; font-size: 0px;
    /* don't try with display:none, trust me */  }
</style>
<ol>
    <li class='hidden'></li>
    <li class='hidden'></li>
    <li class='hidden'></li>
    <li>item 4</li>
    <li>item 5</li>
    <li>item 6</li>
</ol>
y34h
Both `value` on `li` and `start` on `ol` are deprecated by HTML 4.01 and XHTML 1.0. Both are valid in HTML5.
Alohci