Getting Down with ...

by ...

Lesson n:

<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.

Exercises:

  1. Copy minimal_page.html to gdw.html .
  2. Put Getting Down with HTML Exercises in the title and a top level heading (h1) in the body.
  3. Use <h2></h2> elements to create sections with the following labels:
    • Elements
    • Lists
    • Tables
    • Links
    • Images
  4. Use <h3></h3> elements to create sub-sections of the Elements section with these labels:
    • Block-level Elements
    • Inline Elements
    • Object Elements
    • Special Characters
  5. Use <h3></h3> elements to create sub-sections of the Lists section with the following labels:
    • Ordered
    • Unordered
    • Definition
  6. Lastly, use <h3></h3> elements to create sub-sections for the Links section, create sub-sections with these labels:
    • Absolute
    • Relative
  7. Use the w3c validator to validate this web page. Be sure you get a green bar when you submit the page to the validator.

    After completing this exercise, your web page should look something like this.

  8. Now add the validator link to the index.html page you made in Lesson 1. Again, be sure you get a green bar when you check to see if your page syntax is valid.