views:

65

answers:

2

What's the best way to get a ol to start from 'x'?

The start tag is depricated and everything I have found on Google has used the :before pseudo class which doesn't work in IE6 or 7. Didn't have much luck when searching stack either.

Only thing I can think of is manually go through and number the lists myself and style accordingly?

Any help appreciated.

A: 

With ordered lists ol, you could use the various counter CSS instructions: Examples here. But, they also won't work with IE6 and 7. I don't think there is a non-Javascript way to make this work in them.

Pekka
+3  A: 

While the start attribute in HTML 4 is indeed deprecated, looking at the HTML 5 docs, I see:

The start attribute, if present, must be a valid integer giving the ordinal value of the first list item.

If the start attribute is present, user agents must parse it as an integer, in order to determine the attribute's value. The default value, used if the attribute is missing or if the value cannot be converted to a number according to the referenced algorithm, is 1 if the element has no reversed attribute, and is the number of child li elements otherwise.

The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.

which tells me I am safe using start with ol and value with li elements.

Sinan Ünür
True, didn't know that. Thanks.
Colin