Allowed nesting of elements in HTML 4 (and XHTML 1.0)

Legend

Nesting rules for HTML 4.01 Transitional

HTML

Nesting rules for HTML 4.01 Frameset

HTML

In HTML 4.01 Frameset, the content model for NOFRAMES applies inside the BODY too, instead of the content model for NOFRAMES in HTML 4.01 Transitional.


The information here is based on the DTDs, basically the transitional DTD, in the 1999-12-24 version of the HTML 4.01 Specification.

Note that XHTML 1.0 is, as its subtitle says, "A Reformulation of HTML 4 in XML 1.0", so the nesting rules are the same as in HTML 4.01. However, there are the following differences that affect the nesting rules:

Moreover, some of the restrictions on nesting are expressed differently; due to metalanguage differences, some limitations are described in prose only in the XHTML specification, and this implies that a validator will not catch such violations of the limitations when validating against XHTML DOCTYPE but will catch them when an HTML DOCTYPE is used. See section Differences with HTML 4 in the XHTML 1.0 Specification.

Date of last update: 2001-04-06

Interested in related documents? See a list of documents about WWW written or recommended by me.

Specifically, this document has a sister: Allowed nesting of elements in HTML 4 Strict (and XHTML 1.0 Strict), which describes the rules for the Strict versions, which include all elements and attributes that have not been deprecated or do not appear in frameset documents.

Jukka Korpela.