This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Block Elements [June 24, 2011, 12:48 a.m.]


Status: Drafting

There are several primary block elements used in HTML5. We will look at some new and old tags that complement the <head> and <body> duo.

  • <header>
  • <nav>
  • <article>
  • <aside>
  • <footer>
  • <code>
  • <blockquote>


<header>

The <header> tag is a container for introductory materials in a document or section. <header> can be used multiple times in a document and usually contains at least one <h1>-<h6> element (in order to validate).

<header>
  <h1>Section/Document Header</h1>
  <p>A brief description of this section/document</p>
</header>

Further reading:

<nav>

The <nav> tag is used to demarcate a section containing navigation anchors (links) to other content or sections. The anchors can be nested within a list such as an unordered list <ul>.

<nav>
  <h1>Navigation</h1>
  <ul>
    <li><a href="#home">Home</a></li>
    <li><a href="#contact">Contact Us</a></li>
  </ul>
</nav>

Further reading:

 

<article>

The <article> tag designates a region of a document that is self-contained. <article> can be an article, blog post, news story, etc.

<article>
  <img src="image.webp" alt="An image." />
  This is the content for the article.
</article>

Further reading:

<aside>

 

<footer>

 

<code>

 

<bockquote>