HTML and CSS Reference
In-Depth Information
<ul>
<li><a href="/home.html">Home</a></li>
<li><a href="/about.html">About</a></li>
<li><a href="/contact.html">Contact Us</a></li>
</ul>
</nav>
</header>
You can achieve the same result in HTML4 using the code in Listing 3-12.
Listing 3-12.
Creating a Header in HTML4
<div id="header ">
<img src="logo.png" alt="My Company's Logo" />
<ul class="navigation">
<li><a href="/home.html">Home</a></li>
<li><a href="/about.html">About</a></li>
<li><a href="/contact.html">Contact Us</a></li>
</ul>
</div>
<hgroup />
The
<hgroup />
element can be used to group together related headings, such
as an
<h1 />
element for a title, and an
<h2 />
element for a subtitle.
<hgroup />
elements should not contain any elements other than header elements (i.e.,
<h1
/>
,
<h2 />
,
<h3 />
,
<h4 />
, etc.).
The rank of an
<hgroup />
within a document is defined by the highest ranked
header element within that
<hgroup />
.
Listing 3-13 shows how to use an
<hgroup />
in HTML5, and Listing 3-14 shows
how you may have grouped headings in HTML4.