HTML and CSS Reference
In-Depth Information
so too could a Web document be structured in this way. The example here illustrates the
basic use of HTML5 sections:
<section>
<h1> Chapter 2 </h1>
<p> New HTML5 elements .</p>
<section>
<h2> HTML5's section Element </h2>
<p> These elements are useful to create outlines .</p>
<section>
<h3> Nest Away! </h3>
<p> Nest your sections but as you nest you might want to indent. </p>
</section>
</section>
<p> Ok that's enough of that. </p>
</section>
O NLINE http://htmlref.com/ch2/section.html
It may not be obvious but a section element may contain header and footer elements
of its own:
<section>
<header>
<h1> I am Section Heading </h1>
</header>
<h2> I am outside the section header I'm just a plain headline. </h2>
<p> Some more section content might go here. </p>
<footer>
<p> Hi from the footer of this section. </p>
</footer>
</section>
HTML5 uses headings and newly introduced elements like the section element for
outlining purposes. For example, the expanded example here shows a number of sections
with headers, footers, headlines, and content:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> HTML5 expanded section example </title>
</head>
<body>
<header>
<h1> Welcome to the Future World of HTML5 </h1>
<h2> Don't be scared it isn't that hard! </h2>
</header>
Search WWH ::




Custom Search