[thelist] Headers within ordered list in xhtml?

Stephen Rider evolt_org at striderweb.com
Mon Feb 28 15:21:13 CST 2005


On Feb 28, 2005, at 8:42 AM, Bruce Lawson wrote:

> I've a (very) large ordered list of rules. It's split into sections, 
> each with a
> "header"/ subtitle to allow the reader easily to scan to find the rules
> that she wants to read.
...
> The trouble is, the validator tells me that an <hx> tag is illegal
> inside an <ol>.
> I don't want to split the list, as the numbering will be disrupted (and
> I don't want to use the deprecated <li start="34"> attribute after the
> <h3>.

According to this: <http://www.w3.org/TR/REC-html40/struct/lists.html> 
you can use the "value" attribute to continue a numbering sequence.  
This appears to be valid in xhtml.

So:
<ol>
<li>blah</li>
<li>2nd blah</li>
</ol>
<h3>Rules on crocodiles in dormitories:</h3>
<ol>
<li value="3">No crocodiles allowed</li>
<li>Nor alligators</li>
<ol>
<h3>Rules on cobras in dormitories:</h3>
<ol>
<li value="5"> ... </li>
</ol>

OR use nested lists.

Steve



More information about the thelist mailing list