HTML5 introduces a number of semantic elements that act as structural containers for different parts of web pages:
<header> | Contains introductory and / or navigational content. <header> may be used multiple times on a page, and have multiple contexts: for example, <header> may be used immediately after the opening <body> tag to contain the main banner and navigation of the site, and could be used again inside a <section> or <article> to introduce new content.
A <header> will usually appear at the top of the page, but it doesn’t have to: its position and appearance are determined by CSS.
Important note: <header> should not be confused with <head> . Nor is <header> a heading element, like <h1> - <h6> . It is most akin to a masthead.
|
<aside> | Probably the most poorly named of the new tags (an aside is a stage direction or a type of dialogue), <aside> is meant to contain tangentially related information about the document. Asides could be pull quotes, a colophon, or other information. Asides are most akin to a sidebar, but they are not restricted to any particular position on the page. |
<nav> | Intended for major site navigation containing a series of links. In HTML5, this replaces the unordered list navigation structure we were using previously. |
<section> | A container for a group of related content. A successor to the generic <div> tag, although <div> still exists in HTML5. |
<article> | A grouping of self-contained content, such as a blog post. New developers tend to get confused between <section> and <article> : the difference is the emphasis on self-containment. If content could be understood by itself, with no external context required – if it could be taken out an published in an RSS feed, for example – it is an article. Otherwise, <section> or another container element is more appropriate. Adding to the confusion is the fact that articles could also be widgets, or web applications, such as calculators, weather reports, etc. Again, the emphasis is on self-containment: an <article> containing a weather report for Auckland, New Zealand could be moved from one site to another without requiring any additional content or explanation of context. Also note that an <article> nested inside another <article> is, by definition, assumed to be a comment on the parent <article> .
|
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.