HTML Encyclopaedia

Headings

There are six styles of heading known as h1, h2, h3, h4, h5 and h6. They are illustrated below with intervening ordinary text.

This is <h1> style

Ordinary text

This is <h2> style

Ordinary text

This is <h3> style

Ordinary text

This is <h4> style

Ordinary text
This is <h5> style
Ordinary text
This is <h6> style
Ordinary text

All headings are displayed with blank lines above and/or beneath. Not all browsers render all headings distinctly.

In practice h4, h5 and h6 are rarely used.

Since HTML 3.2 the align attribute has been allowed with any of the heading tags. The permitted values are left, center and right. Here are some examples of headings done using the <h2> tag with alignment.

Left aligned heading

Centre aligned heading

Right aligned heading


See also <h1>, <h2>, <h3>, <h4>, <h5>, <h6>