views:

1415

answers:

3

Hello, I have a ordered list where I would like the initial number to be 6. I found that this was supported (now deprecated) in HTML 4.01. In this specification they say that you can specify the starting integer by using css. (instead of the start attribute)

How would you specify the starting number with css?

Thanks

+6  A: 

There is no current CSS or XHTML specification that allows for what you want.

If you need the functionality to start an ordered list (OL) at a specific point, you'll have to specify your doctype as HTML 4.01 Transitional; which is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;

With that doctype, it is valid to set a start attribute on an ordered list. Such as:

<ol start="6">

Alternatively, Array Studio has found a work-around that does what you want. It utilizes CSS's counter-reset and counter-increment functions. I highly recommend you take a look at that.

T Pops
+1  A: 

From w3schools:

Browser Support

The start attribute is deprecated, but still supported in all major browsers.

Compatibility Notes

The start attribute of the ol element was deprecated in HTML 4.01, and is not supported in XHTML 1.0 Strict DTD.

Note: At the moment, there is no CSS alternative for the start attribute.

So there you have it. There is no CSS replacement for the start attribute quite yet. But just because it is deprecated doesn't mean you can't use it. Since it is still supported by all the major browsers, I would just use it (unless you want to resort to PHP or JavaScript to try and do it dynamically, which probably isn't worth it).

Sebastian Celis
A: 

<ol start=""> is not deprecated anymore in HTML5, so I'd just keep using it, regardless of what HTML4.01 says.

Ms2ger