HTML5 Guidelines for Web Developers

(coco) #1
2.1 Header with “header” and “hgroup” 21

2.1 Header with “header” and “hgroup”


In the header we encounter the first two new elements: header and hgroup. Fig-
ure 2.2 shows the markup and the presentation of the header:

<header>
<img>
<hgroup>
<h1>
<h2>
</hgroup>
</header>

Figure 2.2 The basic structure of the HTML5 blog header


The term header as used in the markup specification refers to a container for
headlines and additional introductory contents or navigational aids. Headers are
not only the headers at the top of the page, but can also be used elsewhere in
the document. Not allowed are nested headers or a header within an address or
footer element.


In our case the headline of the HTML5 blog is defined by header in combination
with the logo as an img element and two headings (h1 and h2) surrounded by an
hgroup element containing the blog title and a subtitle.


Whereas it was common practice until now to write the h1 and h2 elements di-
rectly below one another to indicate title and subtitle, this is no longer allowed

Free download pdf