Lloydi
Lloydi

Reputation: 43

Marking up an ordered list to start at point after 1

So, according the W3C spec, the 'start' attribute in an ordered list is deprecated.

If you want to continue a list that's been broken up by a series of heading, you might have:

<ol start="15"> 

But that would not be allowed. The questions is how else could you/would you do it other than that which works in current browsers? Mission impossible?

Upvotes: 2

Views: 107

Answers (2)

Emil Vikstr&#246;m
Emil Vikstr&#246;m

Reputation: 91963

You can do it with CSS counters, but they are not supported in all browsers. The start attribute is your best bet after all.

Upvotes: 0

Matchu
Matchu

Reputation: 85812

The start attribute may be deprecated for HTML4.01, but it has returned for HTML5. Is there a browser compatibility issue?

EDIT: SitePoint says no. So the only real issue is validation. You can use HTML 4.01 Transitional, or HTML5, but not Strict, if you're really concerned about validation.

Otherwise, you're stuck with having the other lines in the HTML and hiding them.

<style type="text/css">.hidden { display: none }</style>

<ol>
    <li class="hidden"></li>
    <li class="hidden"></li>
    <li class="hidden"></li>
    <li class="hidden"></li>
    <li>Starting at 5</li>
</ol>

Upvotes: 1

Related Questions