where n is 1, 2, 3, 4, 5, or 6.
attribute name | possible values | meaning | notes |
---|---|---|---|
ALIGN | LEFT, CENTER, RIGHT | alignment of the heading | deprecated in HTML 4.0 |
The default is left alignment, but this can be overridden by an enclosing DIV or CENTER element. (HTML 2.0, which has no ALIGN attribute, contained no explicit rule for default alignment. On the other hand, it described "typical renderings" presenting H1 as centered and other headings with different amounts of left indentation.)
<H1>Notes on General Relativity</H1>
<H1 ALIGN=CENTER>The story of my life</H1> <H2>Preface</H2> <H3>General remarks</H3>There is a separate file which contains headings of all levels.
Avoid using H5 and H6 at all. More than four levels of headings are rarely needed, and popular browsers may display H5 and H6 in a manner which is less prominent than normal text!
See general structure recommendations for a detailed suggestion on heading usage.
In particular, don't use e.g. H5 or H6 to cause text to be presented in a small font just because some browsers present them so. Other browsers - or even future versions of those browsers - may well adopt the more reasonable view that even the lowest level headings should be presented at least as prominently as normal text. If small font is what you really want, use the SMALL (or FONT) element.
Since heading elements are intended to be presented prominently by a browser, don't make them very long. Normally you should not try to add anything to the presentation by using text markup within the heading text. It is the job of a browser to present headings as headings. And for the same reason you should not write a heading in all upper case.
It might be a good idea to
make every heading an anchor,
i.e.
a possible target of a
link.
Use the A element with
NAME attribute for this.
Example:
<H2><A NAME="intro">Introduction</A></H2>
Other people (or you) may then link to specific sections in your
document, not just to the document as a whole.
Notice that you must put the A element within
the heading element, not vice versa.