Next Previous Contents HTML 4.0 compliance checked by http://validator.w3.org

7.5.5 Headings (Hn)

Headings are for identifying various parts of the text. They are inline (though normal usage at the beginning of a document or of a division makes them look like block material). Here are headers as they normally would be found. Each first comes at the start of its own division (the previous division always ends with a paragraph), and then as inline material at the start of a separate paragraph.

The standard doesn't say it, but at least as styled by Netscape Navigator and Microsoft Internet Explorer, H1, H2 and H3 are more suitable as block-level material, while H4, H5 and H6 have a font size equal or smaller than the body text, so they seem better inline within the paragraph. The HTML 4.0 standard specifies that all the headers are inline material. Thus an enclosing style such as <DIV>, or a <BR>, is needed to produce a line break before the heading, and typically <P> provides the line break after it.

Unfortunately, in HTML 2.0 and 3.2 the H elements clearly were able to end a block by themselves (<DIV> did not exist then), many web pages depend on this behavior, and popular browsers render all H elements as blocks, not inline. For backward compatibility it would be best if an H element would close a previous block but its ending would appear to be inline, requiring a following <P> if the author wants it to close.

Heading Type H1

First paragraph of division.

Heading Type H1.

This paragraph starts with the heading.

Heading Type H2

First paragraph of division.

Heading Type H2.

This paragraph starts with the heading.

Heading Type H3

First paragraph of division.

Heading Type H3.

This paragraph starts with the heading.

Heading Type H4

First paragraph of division.

Heading Type H4.

This paragraph starts with the heading.
Heading Type H5

First paragraph of division.

Heading Type H5.
This paragraph starts with the heading.
Heading Type H6

First paragraph of division.

Heading Type H6.
This paragraph starts with the heading.

CENTER is an extremely deprecated tag, not even mentioned in the HTML 4.0 standard. Nonetheless it is often used with headings to center the text. It is a block level tag, and a similar effect can be obtained with <P ALIGN=CENTER> or <H1 ALIGN=CENTER> (but the latter forms are also deprecated in favor of CSS style effects). Here's one following immediately after this sentence.

This text should be centered.

Next Previous Contents