Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

Adding headings

You might want to add headings to your page in the same way that you have headings in printed documents. There are six levels of heading: <h1> is the most important, followed by <h2> and so on down to <h6>.

The <hn> tags decrease the size of the text as the level of the heading decreases. You always need the </hn> end-tag.

Typically, headings might look like:

There is a blank line before and after the heading.

You shouldn’t skip heading levels (not so different to paper then).

Usually, headings are left aligned but you can override the default alignment. For example, to centre the heading, use the align attribute as follows:

<h2 align="center">How to use my web page</h2>

As a heading always has a line break after it. In other words, you can’t have two headings on the same line. Well you can with CSS but that's another story and it doesn't work anyway.

If you want to, you can use a different font face, size or colour for your headings.