This is a snapshot of an early working draft and has therefore been superseded by the HTML standard.

This document will not be further updated.

HTML 5

Call For Comments — 27 October 2007

3.20. Miscellaneous elements

3.20.1. The legend element

Contexts in which this element may be used:
As the first child of a fieldset element.
As the first child of a details element.
As a child of a figure element, if there are no other legend element children of that element.
Content model:
If used as a child of a fieldset or details element: significant strictly inline-level content
If used as a child of a figure element: inline-level content.
Element-specific attributes:
None.
DOM interface:
No difference from HTMLElement.

The legend element represents a title or explanatory caption for the rest of the contents of the legend element's parent element.

3.20.2. The div element

Block-level element.

Contexts in which this element may be used:
Where block-level elements are expected.
Content model:
Zero or more style elements, followed by either zero or more block-level elements, or inline-level content (but not both).
Element-specific attributes:
None.
DOM interface:
No difference from HTMLElement.

The div element represents nothing at all. It can be used with the class, lang/xml:lang, and title attributes to mark up semantics common to a group of consecutive elements.

Allowing div elements to contain inline elements makes it easy for authors to abuse div, using it with the class="" attribute to the point of not having any other elements in the markup. This is a disaster from an accessibility point of view, and it would be nice if we could somehow make such pages non-compliant without preventing people from using divs as the extension mechanism that they are, to handle things the spec can't otherwise do (like making new widgets).