ToC ~ Up ~ Prev ~ Next ~ Index Introduction to HTML
Last Update: 5 January 1998

4.2 Section Headings

HTML allows for six levels of headings, marked by the element names H1, H2... H6. There is no forced hierarchy in these headings, but for consistency you should use the top level (H1) for main headings, and lower levels for progressively less important ones. In general hypertext documents should be broken up so that each page does not occupy much more than a single screen. In these cases you can use the H1 heading to mark the main document heading, and the others to mark subheadings.

4.2.1 Heading Alignment: The ALIGN Attribute

HTML 3 proposed an ALIGN attribute to the heading element, which allows an author to "hint" at the desired alignment of the heading on the display.The possible values are ALIGN="left" (the default) to left-align the heading, ALIGN="center" to center the heading, and ALIGN="right" to right-align the heading. Several browsers understand left and center alignment, while very few understand right-alignment. Some examples are shown below.

4.2.2 Examples of Headings

The following examples show the HTML coding for the six heading types, along with the results (note that the results will vary from viewer to viewer)


<H1 align="left"> Heading type H1 </H1>

Heading type H1


<H2 align="center"> Heading type H2 </H2>

Heading type H2


<H3 align="right"> Heading type H3 </H3>

Heading type H3


<H4> Heading type H4 </H4>

Heading type H4


<H5> Heading type H5 </H5>

Heading type H5

<H6> Heading type H6 </H6>

Heading type H6

ToC ~ Up ~ Prev ~ Next ~ Index Introduction to HTML
© 1994-1998 by Ian Graham
Last Update: 5 January 1998