HTML optimization : H1, …, H6 tags (1st part)

January 28th, 2008

We start today with our first phase on optimizing Meta tags. If you are new to HTML, you will find a short introduction (the basics) in our previous article “HTML basics in the Search Engine Optimization (SEO) scope”.

What are H1 to H6 tags ?

If you look at the HTML code of the HTML4SEO Faq (right click + View source in Internet Explorer), you will find this part of code,

code tag h1 h6

This code allows to display several title in the page. Below is the result.

preview tag h1 h6

The tag number (from 1 to 6) increases with the title level of detail. The H1 titles are the most important, so the most visible (usually with a bigger font and eventually a color which is different from the rest of the text), whereas H6 tags are the least important.

H1 to H6 tags, according to the HTML 4.01 standard

The HTML 4.01 standard stands that :

  • each HTML document can (not mandatory) have 1 or more H1 to H6 titles,
  • each H1 to H6 tag must have an opening tag <Hn> and a closing tag </Hn>,
  • there are 6 title levels, the H1 element is the most important and H6 is the least important.

Here is an example of H1, H2 and H3 elements well-formed :

<HTML>
<HEAD>
... Head elements ...
</HEAD>
<BODY>
	... introduction of the document ...
	<H1>Freshwater fishes</H1>
	... a short introduction about freewater fishes here ...
	<H2>In Europ</H2>
	… a text dealing with the specificities of these fishes in Europ here …
	<H3>In northern Europ </H3>
	… details about northern Europ fishes …
	<H3>In western Europ </H3>
	… details about western Europ fishes …
	...
	<H2>In Asia</H2>
	… a text dealing with the specificities of these fishes in Asia here …
	...
	<H1>Seawater fishes</H1>
	...
</BODY>
</HTML>

According to the standard, respecting the hierarchy of the H1 to H6 tags is not mandatory but it is highly recommended. In the previous example, titles are properly set.

Avoid,

<H1>Africa elephants</H1>
...
<H3>In southern Africa</H3>
...
<H2>Asian elephants</H2>
...
<H3>In southeast Asia</H3>
...

Notice that the title level of the opening tag must be the same as the one of the closing tag.

Here is an example of a valid title :

<H1>Bicycle Repairman</H1>

The following title is not valid and can even damage the formatting of the document

<H1>Bicycle Repairman</H2>

What is the importance of H1 to H6 tags ?

H1 to H6 tags in the body of a web page

H1 to H6 tags are probably the most important from the whole text of a web page. After the TITLE tag, the H1 tag seems to be the most SEO decisive tag. When correctly chosen, the titles introduce the content that follows (in some ways, they are representative). Therefore they provide the most relevant words to identify the document.

H1 to H6 tags between them

For search engines, H1 to H6 tags do not have the same weight. The H1 tags, the most important among titles, are as important for the SEO. The more you increase the title level (H2, H3, H4, H5 and H6), the least its content will be taken in account by search engines. Therefore the inner content of a H1 tag will be more important than the one of a H2 tag, this one will be more important than the one of a H3 tag and so on until H6. Focus your optimization efforts on H1 title first, then on H2, etc…