[whatwg] List Headers

Garrett Smith dhtmlkitchen at gmail.com
Wed Feb 4 12:39:41 PST 2009


On Wed, Feb 4, 2009 at 2:50 AM, Lachlan Hunt <lachlan.hunt at lachy.id.au> wrote:
> Christian Svindseth wrote:
>>
>> On Feb 4, 2009, at 11:13 AM, Robert O'Rourke wrote:
>>>
>>> Are there any plans to bring list headers from HTML3 into HTML5? They'd
>>> make a lot of markup patterns simpler and be very very useful when it comes
>>> to styling.
>>>
>>> http://www.w3.org/MarkUp/html3/listheader.html
>>
>> Unless I'm misreading the spec completely, HTML5 supports h1-h6, and even
>> header elements inside list items.
>
> While you can include headings within li elements, that's different from
> what the lh element in HTML3, or even the label element in XHTML2, were
> designed for.
>
> I believe the use case is providing a title indicating the content of the
> list, but where the title itself shouldn't contribute to the document's
> outline.  In HTML5, the only way to do this is to precede a list with an
> heading (h1-h6) element.
>
> As an example of this, consider the element summaries in the HTML 5
> Reference, the attribute list has the heading Attributes, but that heading
> is not meant to affect the document's outline and doesn't appear in the TOC.
>  I had to use class="no-num no-toc", which is recognised by anolis (the
> spec's pre-processor tool), to avoid it being included in the TOC.
>
> http://dev.w3.org/html5/html-author/#the-elements
>
> But note that the issue itself doesn't affect just lists.  The same issue
> occurs for the DOM Interfaces sections, but that content isn't marked up as
> a list, and I'm also considering changing the attributes to use a table
> instead of a list, providing the attributes and associated descriptions.
>

Is this what you are referring to:-

| <h4 id="reflecting-content-attributes-in-dom-attributes"
| ><span class="secno">2.8.1 </span>Reflecting content attributes in
| DOM attributes</h4>

?

That is not marked up as a list; it uses an H4. I don't see the
similarity to the problem of wanting to have a header within a list.

The LH or element is used specifically to provide a title for a list.

The HTML 3 spec says:
| Permitted Context: Immediately following UL, OL or DL

Browsers do allow adding the lh anywhere inside the list.

Example:-

<!DOCTYPE HTML>
<html lang="en">
<head>
	<title>list header</title>
</head>
<body>
<h1>Ingredients</h1>
 <ol style="list-style-type: iroha">
   <lh>Dry:</lh>
     <li>1c flour</li>
     <li>1/4c sugar</li>
     <li>1tsp baking soda</li>
   <lh>Wet:</lh>
     <li>1 egg </li>
     <li>1/2c milk</li>
     <li>1tsp vanilla extract</li>
  </ol>
</body>
</html>

Is rendered in FF3, Saf2,3, Op 9:-
   Dry:
   1. 1c flour
   2. 1/4c sugar
   3. 1tsp baking soda
   Wet:
   4. 1 egg
   5. 1/2c milk
   6. 1tsp vanilla extract

The HTML5 <figure> element does not allow for subsections in the list.



More information about the whatwg mailing list