demosthenes.info

I’m Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with , and . To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

web developer guide

my books

Book cover of Pro CSS3 AnimationPro CSS3 Animation, Apress, 2013

my projects

A Sass color keyword system for designers. Replaces CSS defaults with improved hues and more memorable, relevant color names.

CSSslidy: an auto-generated #RWD image slider. 3.8K of JS, no JQuery. Drop in images, add a line of CSS. Done.

tipster.ioAutomatically provides local tipping customs and percentages for services anywhere.

HTML5 Section Elements

html / elements

Estimated reading time: 2 minutes, 55 seconds

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

<footer>

Contains closing, summary information about its parent element. Again, we should have multiple footers in the page, inside both <section> and <article> tags. They do not have to appear at the bottom of the page. A <footer> inside the body might contain copyright information, but a footer inside a blog post <article> tag would typically contain an author byline or related information.

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

comments powered by Disqus

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.