<h1>Title</h1>
<h2>Section</h2>
<h3>Sub-section</h3>
<h4>Sub-sub-section</h4>
<h5>Sub-sub-sub-section</h5>
<h6>Sub-sub-sub-sub-section</h6>
Heading elements are used to divide your document into sections
and subsections. The top-level heading, h1
, will usually occur
only once in a document and will contain the title of the document. It will
often contain the same content as the
<title></title>
element.
By default, each successive heading element is styled to indicate
decreasing importance. h2
is most often used as a section
title, so it is rendered in a smaller font, giving it less emphasis than
h1
. The h3
element is used for sub-sections, and
receives less emphasis still, and so on. The chain of emphasis decreases as
all the way to h6
. Since information is not usually subdivided
into sub-sub-sections and beyond, h4
elements and below are
less commonly used than the higher-lever heading elements.
Syntax Validation
HTML is a formal language, and like all formal languages is has a well defined set of rules for its syntax.
The World Wide Web Consortium (W3C) provides a web site to check the syntax, or markup validation of your web pages. The URL for the validator is http://validator.w3.org. You can check your pages to see if they have correct syntax by copy and pasting, uploading, or entering a web address for them (if they are on a public website).
A green bar means your page has passed validation, and a red bar means it contains errors. You should check all your pages as you go through this tutorial and be sure you get a green bar.
Validation Link
If your web page is publicly accessible, you can add this to the bottom
of your page (above the </body>
tag) to create a link
that sends your page to the W3C for validation:
<footer style="text-align: center;"> <a href="http://validator.w3.org/check/referer"> <strong> HTML </strong> Valid! </a> </footer>
Here is version of the minimal_page.html
with the
validation link included. After clicking on the link, right mouse click on
the page that loads (which will look completely empty except for the
HTML Valid!
link) and select Save Page As...
to
download a local copy of the page.