HTML Headings

You already met H1 on your first Web page but there are more levels of heading.

Sub-headings

The first heading on this page is an H1 but there are many levels of heading in HTML.

H3

The second heading on this page ("Sub-headings") is an H2. The heading just above this line is H3.

H3 again

The idea is to give structure to your page. Like in a formal printed report. The H2 headings are less important. They mark a sub-section of the main heading.

An excuse for an H2

This last heading goes back to H2 and would normally be used to start a new sub-section. It might have more H3 headings in it or even H4, H5, H6 etc.. Normally only the first three or four are needed.

Why should you use H tags and not just make the text larger and bolder?

There are two main reasons.

Accessibility

People who use screenreaders (turning text into sound) rely on the H tags for knowing which parts are headings.

Search engines

Seach engines look on headings as important. When they see this page they will use the main H1 heading to judge what the page is about. They will look at other text but H1 is most important.

Practice

Add at least two each of H1, H2 and H3 elements to your first HTML page. Put at least one paragraph between each heading. View the results in a browser.

submit to reddit Delicious Tweet