Headings in HTML

February 2017


HTML can use six different levels of headings to define the hierarchical structure of paragraphs in a document:

TagVisual Effect
H1 Test
H2 Test
H3 Test
H4 Test
H5 Test
H6 Test


The following attributes are placed within structure tags so that the HTML elements can be displayed in specific places:

Attribute Value Visual Effect




Left-aligned text

Right-aligned text

centred text

Justified text

NOWRAP   Prevents the browser from creating a line break.
ID   Gives the tag an identification. This attribute is especially useful for programming with JavaScript
LANG   Specifies a different language
CLASS   Assigns a class to the contents (for style sheets)
CLEAR   Used when text is surrounding an image. It brings the text as far down on the page as needed in order to have a clear margin.

Here is an example header:

<H1 ALIGN=JUSTIFY> Justified text </H1>


Encabezados en HTML
Encabezados en HTML
Niveaux de titres en HTML
Niveaux de titres en HTML
Livelli di titoli in HTML
Livelli di titoli in HTML
Níveis de títulos em HTML
Níveis de títulos em HTML
Kodowanie typu quoted-printable
Kodowanie typu quoted-printable
This document, titled "Headings in HTML," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).