[thelist] Headers within ordered list in xhtml?

Douglas Clifton dwclifton at gmail.com
Tue Mar 1 09:08:56 CST 2005


Bruce,

You're already sendling the correct DOCTYPE to do this (XHTML 1.0 Transitional),
all you have to do now is close the list and restart the numbering
sequence after
you output the <h3> heading:

<ol>
<li>one</li>
<li>two</li>
</ol>
<h3>Heading level 3 Here</h3>
<ol>
<li value="3">three</li>
<li>four</li>
</ol>

This is perfectly valid code for that DOCTYPE.

Doug

On Tue, 1 Mar 2005 09:23:12 -0000, Bruce Lawson
<Bruce.Lawson at lawsociety.org.uk> wrote:
> 
> Stephen Rider <evolt_org at striderweb.com> writes:
> > 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.Perhaps if the original poster were
> to give us an example of what he's after we could > > help? You could
> also achieve this effect with CSS.
> 
> Here's what I want to achieve (ignore the ads at the top!)
> http://zengarden.20megsfree.com/goltest.htm
> 
> The <h3> serves to guide the eye to the correct place in the list (like
> words in the header of dictionary pages, for example); I do *not* want
> to introduce a sub-list, because the points under a header are not a
> sub-list. It's one flat list of rules, and I don't want to disrupt the
> numbering, but do want to guide the eye.
> 
> Similarly, I could break the list down into separate ordered lists,
> interspersed with headings, but semantically it's *not* separate lists,
> and I lose the value of the "auto-numbering" of the ol if I have to
> restart the numbering manually with value attributes after the headings.
> 
> Personally, I think this is one time when I need invalid xhtml - as
> hacking my list into sublists/ smaller lists is a bigger anti-semantic
> hack than the invalid headers inside a list.
> 
> Thanks to those who've already looked at this for me; any more thoughts,
> dear comrades?
> 
> Bruce


More information about the thelist mailing list