Seções e estrutura de um documento HTML5

  • Revision slug: Seções_e_estrutura_HTML5
  • Revision title: Seções e estrutura de um documento HTML5
  • Revision id: 292953
  • Criado:
  • Criador: AluisioASG
  • É a revisão atual? Não
  • Comentar

Conteúdo da revisão

A especificação HTML5 traz vários novos elementos aos desenvolvedores web, permitindo-os descrever a estrutura de um documento web com semânticas padronizadas. Este documento descreve esses elementos e como utilizá-los para definir a estrutura desejada para qualquer documento.

Estrutura de um documento em HTML4

A estrutura de um documento, ou seja, a estrutura semântica do que está entre <body> e </body>, é fundamental para a apresentação da página ao usuário. HTML4 usa a noção de seções e subseções de um documento para descrever sua estrutura. Uma seção é definida por um Elemento HTML de Divisão ({{ HTMLElement("div") }}) com Elementos HTML de Cabeçalho ({{ HTMLElement("h1") }}, {{ HTMLElement("h2") }}, {{ HTMLElement("h3") }}, {{ HTMLElement("h4") }}, {{ HTMLElement("h5") }}, ou {{ HTMLElement("h6") }}) dentro de si, definindo seu título. As relações deses elementos levam à estrutura do documento.

Então a seguinte marcação:

<DIV class="section" id="floresta-elefantes" >
<H1>Elefantes-da-floresta</H1>
<P>Nesta seção, discutiremos os pouco conhecidos elefantes-da-floresta.
...esta seção continua...
<DIV class="subsection" id="floresta-habitat" >
<H2>Habitat</H2>
<P>Os elefantes-da-floresta não vivem em árvores mas sim entre elas.
...esta subseção continua...
</DIV>
</DIV>

leva à seguinte estrutura:

1. Elefante-da-floresta
   1.1 Habitat

Os elementos {{ HTMLElement("div") }} não são obrigatórios para definir uma nova seção. A mera presença de um Elemento de Cabeçalho HTML é suficiente para implicar uma nova seção. Portanto,

<H1>Elefante-da-floresta</H1>
<P>Nesta seção, discutiremos os pouco conhecidos elefantes-da-floresta.
...esta seção continua...
<H2>Habitat</H2>
<P>Os elefantes-da-floresta não vivem em árvores mas sim entre elas.
...esta subseção continua...
<H2>Dieta</H2>
<H1>Esquilo-da-mongólia</H1>

leva à:

1. Elefante da floresta
   1.1 Habitat
   1.2 Dieta
2. Esquilo-da-mongólia

Problemas resolvidos pelo HTML5

A definição HTML 4 da estrutura de um documento e seu algoritmo de estruturação implícita and leads to numerous problems:

  1. Usage of {{ HTMLElement("div") }} for defining semantic sections, without defining specific values for the class attributes makes the automation of the outlining algorithm impossible ("Is that {{ HTMLElement("div") }} part of the outline of the page, defining a section or a subsection?" Or "is it only a presentational {{ HTMLElement("div") }}, only used for styling?"). In other terms, the HTML4 spec is very imprecise on what is a section and how its scope is defined. Automatic generation of outlines is important, especially for assistive technology, that are likely to adapt the way they present information to the users according to the structure of the document. HTML5 removes the need for {{ HTMLElement("div") }} elements from the outlining algorithm by introducing a new element, {{ HTMLElement("section") }}, the HTML Section Element.
  2. Merging several documents is hard: inclusion of a sub-document in a main document means changing the level of the HTML Headings Element so that the outline is kept. This is solved in HTML5 as the newly introduced sectioning elements ({{ HTMLElement("article") }}, {{ HTMLElement("section") }}, {{ HTMLElement("nav") }} and {{ HTMLElement("aside") }}) are always subsections of their nearest ancestor section, regardless of what sections are created by internal headings.
  3. Because each HTML Heading Element is part of the outline, it is not possible to describe a subtitle or secondary title (e.g., <h1>Justine</h1><h2>Les Malheurs de la Vertu</h2> creates the outline 1. Justine 1.1 Les Malheurs de la Vertu). HTML5 introduces the {{ HTMLElement("hgroup") }} element that hides all the heading elements except the first one of the highest rank (e.g., <hgroup><h1>Justine</h1><h2>Les Malheurs de la Vertu</h2></hgroup> creates the outline 1. Justine).
  4. In HTML4, every section is part of the document outline. But documents are often not that linear. A document can have special sections containing information that is not part of, though it is related to, the main flow, like an advertisement block or an explanation box. HTML5 introduces the {{ HTMLElement("aside") }} element allowing such sections to not be part of the main outline.
  5. Again, in HTML4, because every section is part of the document outline, there is no way to have section containing information related not to the document but to the whole site, like logos, menus, table of contents, or copyright information and legal notices. For that purpose, HTML5 introduces three specific sections elements: {{ HTMLElement("nav") }} for collections of links, such as a table of contents, {{ HTMLElement("footer") }} and {{ HTMLElement("header") }} for site-related information.

More generally HTML5 brings precision to the sectioning and heading features, allowing document outlines to be predictable and used by the browser to improve the user experience.

The HTML5 Outline Algorithm

Defining Sections in HTML5

All content lying inside the {{ HTMLElement("body") }} element is part of a section. Sections in HTML5 can be nested. Beside the main section, defined by the {{ HTMLElement("body") }} element, section limits are defined either explicitly or implicitly. Explicitly-defined sections are the content within {{ HTMLElement("body") }},  {{ HTMLElement("section") }},  {{ HTMLElement("article") }},  {{ HTMLElement("aside") }}, {{ HTMLElement("footer") }},  {{ HTMLElement("header") }}, and {{ HTMLElement("nav") }} tags. 

Note: Each section can have its own heading hierarchy. Therefore, even a nested section can have an {{ HTMLElement("h1") }}. See Defining Headings in HTML5.

Example:

<section>
  <h1>Forest elephants</h1> 
  <section>
    <h1>Introduction</h1>
    <p>In this section, we discuss the lesser known forest elephants.
  </section>
  <section>
    <h1>Habitat</h1>
    <P>Forest elephants do not live in trees but among them. 
  </section>
  <aside>
    <p>advertising block
  </aside>
</section>
<footer>
  <p>(c) 2010 The Example company
</footer> 

This HTML snippet defines two top-level sections:

 <section>   
  <h1>Forest elephants</h1>    
  <section>     
    <h1>Introduction</h1>     
    <p>In this section, we discuss the lesser known forest elephants.
  </section>   
  <section>     
    <h1>Habitat</h1>
    <P>Forest elephants do not live in trees but among them. 
  </section>
   <aside>
    <p>advertising block
  </aside>
</section>
<footer>
  <p>(c) 2010 The Example company
</footer>

The first section has three subsections:

<section>
   <h1>Forest elephants</h1>
   <section>     
     <h1>Introduction</h1>     
     <p>In this section, we discuss the lesser known forest elephants.
   </section>   
   <section>     
     <h1>Habitat</h1>
     <P>Forest elephants do not live in trees but among them. 
   </section>
   <aside>
     <p>advertising block
   </aside>
 </section>
 <footer>
   <p>(c) 2010 The Example company
 </footer>

This leads to the following structure:

1. Forest elephants
   1.1 Introduction
   1.2 Habitat
   1.3 Section (aside)

Defining Headings in HTML5

While the HTML Sectioning elements define the structure of the document, an outline also needs headings to be useful. The basic rule is simple: the first HTML heading element (one of {{ HTMLElement("h1") }}, {{ HTMLElement("h2") }}, {{ HTMLElement("h3") }}, {{ HTMLElement("h4") }}, {{ HTMLElement("h5") }}, {{ HTMLElement("h6") }}) defines the heading of the current section.

The heading elements have a rank given by the number in the element name, where {{ HTMLElement("h1") }} has the highest rank, and {{ HTMLElement("h6") }} has the lowest rank. Relative ranking matters only within a section; the structure of the sections determines the outline, not the heading rank of the sections. For example, this code:

<section>
  <h1>Forest elephants</h1>    
  <p>In this section, we discuss the lesser known forest elephants. 
     ...this section continues...
  <section>
     <h2>Habitat</h2>  
     <p>Forest elephants do not live in trees but among them.
        ...this subsection continues...
  </section>
</section>
<section>
  <h3>Mongolian gerbils</h3>
  <p>In this section, we discuss the famous mongolian gerbils. 
     ...this section continues...
</section>

leads to the following outline:

1. Forest elephants
   1.1 Habitat
2. Mongolian gerbils

Note that the rank of the heading element (in the example {{ HTMLElement("h1") }} for the first top-level section, {{ HTMLElement("h2") }} for the subsection and {{ HTMLElement("h3") }} for the second top-level section) is not important. (Any rank can be used as the heading of an explicitly-defined section, although this practice is not recommended.)

Implicit Sectioning

Because the HTML5 Sectioning Elements aren't mandatory to define an outline, to keep compatibility with the existing web dominated by HTML4, there is a way to define sections without them. This is called implicit sectioning.

The HTML Headings Elements ({{ HTMLElement("h1") }} to {{ HTMLElement("h6") }}) defines a new, implicit, section when they aren't the first heading of their parent, explicit, sections. The way this implicit section is positioned in the outline is defined by its relative rank with the previous heading in their parent section. If it is of a lower rank than the previous heading, it opens a implicit sub-section of the section. This code:

<section>
  <h1>Forest elephants</h1>  
  <p>In this section, we discuss the lesser known forest elephants.
     ...this section continues...
  <h3 class="implicit subsection">Habitat</h3>
    <p>Forest elephants do not live in trees but among them.
       ...this subsection continues...
</section> 

leading to the following outline:

1. Forest elephants
   1.1 Habitat (implicitly defined by the h3 element)

If it is of the same rank as the previous heading, it closes the previous section (which may have been explicit!) and opens a new implicit one at the same level: 

<section>
  <h1>Forest elephants</h1>  
  <p>In this section, we discuss the lesser known forest elephants.
     ...this section continues...
  <h1 class="implicit section">Mongolian gerbils</h1>
  <p>Mongolian gerbils are cute little mammals.
     ...this section continues...
</section>

leading to the following outline: 

1. Forest elephants
2. Mongolian gerbils (implicitly defined by the h1 element, which closed the previous section at the same time)

If it is of a higher rank than the previous heading, it closes the previous section and opens a new implicit one at the higher level:

<body>
  <h1>Mammals</h1>
  <h2>Whales</h2>
  <p>In this section, we discuss the swimming whales.
     ...this section continues...
  <section>
    <h3>Forest elephants</h3>  
    <p>In this section, we discuss the lesser known forest elephants.
      ...this section continues...
    <h3>Mongolian gerbils</h3>
      <p>Hordes of gerbils have spread their range far beyond Mongolia.
         ...this subsection continues...
    <h2>Reptiles</h2>
      <p>Reptiles are animals with cold blood.
          ...this subsection continues...
  </section>
</body>  

leading to the following outline:

1. Mammals
   1.1 Whales (implicitly defined by the h2 element)
   1.2 Forest elephants (explicitly defined by the section element)
   1.3 Mongolian gerbils (implicitly defined by the h3 element, which closes the previous section at the same time)
   1.4 Reptiles (implicitly defined by the h2 element, which closes the previous section at the same time)

This is not the outline that one might expect by quickly glancing at the heading tags. To make your markup human-understandable, it is a good practice to use explicit tags for opening and closing sections, and to match the heading rank to the intended section nesting level. However, this is not required by the HTML5 specification. If you find that browsers are rendering your document outline in unexpected ways, check whether you have sections that are implicitly closed by heading elements.

An exception to the rule of thumb that heading rank should match the section nesting level is for sections that may be reused in multiple documents. For example, a section might be stored in a content-management system and assembled into documents at run time. In this case, a good practice is to start at {{ HTMLElement("h1") }} for the top heading level of the reusable section. The nesting level of the reusable section will be determined by the section hierarchy of the document in which it appears. Explicit section tags are still helpful in this case.

Overriding Implicit Sectioning

 Sometimes, a section needs to have several headings. A few usual cases are:

  • a section about a book, or a movie, that has a secondary title:
    <section>
      <h1>Justine</h1>
      <h2>Les Malheurs de la vertu</h2>
    </section>

    leads to the following outline:

    1. Justine
       1.1 Les Malheurs de la vertu
    
  • the secondary heading may be used for a tag list:
    <section>
      <h1>Section and outlines of a document</h1>
      <h2>HTML, HTML5, Sections, Outlines</h2>
    </section>

    leads to the following outline:

    1. Section and outlines of a document
       1.1 HTML, HTML5, Sections, Outlines

Due to the implicit sectioning, this is not possible without the help of the HTML Headings Group Element ({{ HTMLElement("hgroup") }} introduced in HTML5). It hides all headings from the outline, except the first one, allowing an override of the implicit sectioning. With this element the secondary book example:

<section>
  <hgroup>
    <h1>Justine</h1>
    <h2>Les Malheurs de la vertu</h2>
  </hgroup>
</section>

leads to the following outline:

1. Justine

Sectioning roots

 A sectioning root is an HTML element that can have its own outline, but the sections and headings inside them do not contribute to the outline of their ancestor. Beside {{ HTMLElement("body") }} which is the logical sectioning root of a document, these are often elements that introduce external content to the page: {{ HTMLElement("blockquote") }}, {{ HTMLElement("details") }}, {{ HTMLElement("fieldset") }}, {{ HTMLElement("figure") }} and {{ HTMLElement("td") }}.

Example:

<section>
  <h1>Forest elephants</h1> 
  <section>
    <h2>Introduction</h2>
    <p>In this section, we discuss the lesser known forest elephants
  </section>
  <section>
    <h2>Habitat</h2>
    <p>Forest elephants do not live in trees but among them. Let's
       look what scientists are saying in "<cite>The Forest Elephant in Borneo</cite>":
    <blockquote>
       <h1>Borneo
       <p>The forest element lives in Borneo...
    </blockquote>
  </section>
</section>

This example results in the following outline:

1. Forest elephants
   1.1 Introduction
   1.2 Habitat

This outline doesn't contain the internal outline of the {{ HTMLElement("blockquote") }} element, which, being an external citation, is a sectioning root and isolates its internal outline.

Sections outside the outline

 HTML5 introduces four new elements that allow defining sections that don't belong to the main outline of a web document:

  1. The HTML Aside Section Element ({{ HTMLElement("aside") }}) defines a section that, though related to the main element, doesn't belong to the main flow, like an explanation box or an advertisement. It has its own outline, but doesn't belong to the main one.
  2. The HTML Navigational Section Element ({{ HTMLElement("nav") }}) defines a section that contains navigation links. There can be several of them in a document, for example, one with page internal links, like a table of content, and another one with site navigational links. These links are not part of the main flow and outline and can be typically initially not rendered by screen reader and similar assistive technology.
  3. The HTML Header Section Element ({{ HTMLElement("header") }}) defines a page header, typically containing the logo and name of the site and possibly a horizontal menu. Despite its name, it is not necessarily positioned at the beginning of the page.
  4. The HTML Footer Section Element ({{ HTMLElement("footer") }}) defines a page footer, typically containing the copyright and legal noticed and sometimes some links. Despite its name, it is not necessarily positioned at the bottom of the page.

Addresses and publication time in sectioning elements

The author of a document often wants to publish some contact information, such the author's name and address. HTML4 allowed this via the {{ HTMLElement("address") }} element, which has been extended in HTML5.

A document can be made of different sections from different authors. A section from another author than the one of the main page is defined using the {{ HTMLElement("article") }} element. Consequently, the {{ HTMLElement("address") }} element is now linked to its nearest {{ HTMLElement("body") }} or {{ HTMLElement("article") }} ancestor.

Similarly, the new HTML5 {{ HTMLElement("time") }} element, with its {{ htmlattrxref("pubdate", "time") }} boolean attribute set, represents the publication date associated to the whole document, respectively to the article, related to its nearest {{ HTMLElement("body") }} or {{ HTMLElement("article") }} ancestor.

Using HTML5 Elements in Non-HTML5 Browsers

Sections and headings elements should work in most non-HTML5 browsers. Though unsupported, they don't need a special DOM interface and they only need a specific CSS styling as unknown elements are styled as display:inline by default:

section, article, aside, footer, header, nav, hgroup {
  display:block;
}

Of course the web developer can style them differently, but keep in mind that in a non-HTML5 browser, the default styling is different from what is expected for such elements. Also note that the {{ HTMLElement("time") }} element has not been included, because the default styling for it in a non-HTML5 browser is the same as the one in an HTML5-compatible one.

This method has its limitation though, as some browsers do not allow styling of unsupported elements. That is the case of the Internet Explorer (version 8 and earlier), which need a specific script to allow this:

<!--[if lt IE 9]>
  <script>
    document.createElement("header" );
    document.createElement("footer" );
    document.createElement("section"); 
    document.createElement("aside"  );
    document.createElement("nav"    );
    document.createElement("article"); 
    document.createElement("hgroup" ); 
    document.createElement("time"   );
  </script>
<![endif]-->

This script means that, in the case of Internet Explorer (8 and earlier), scripting should be enabled in order to display HTML5 sectioning and headings elements properly. If not, they won't be displayed, which may be problematic as these elements are likely defining the structure of the whole page. That's why an explicit {{ HTMLElement("noscript") }} element should be added for this case:

<noscript>
   <strong>Warning !</strong>
   Because your browser does not support HTML5, some elements are simulated using JScript.
   Unfortunately your browser has disabled scripting. Please enable it in order to display this page.
</noscript>

This leads to the following code to allow the support of the HTML5 sections and headings elements in non-HTML5 browsers, even for Internet Explorer (8 and older), with a proper fallback for the case where this latter browser is configured not to use scripting:

<!--[if lt IE 9]>
  <script>
    document.createElement("header" );
    document.createElement("footer" );
    document.createElement("section"); 
    document.createElement("aside"  );
    document.createElement("nav"    );
    document.createElement("article"); 
    document.createElement("hgroup" ); 
    document.createElement("time"   );
  </script>
  <noscript>
     <strong>Aviso !</strong>
     Seu navegador web não suporta HTML5, e devido a isso alguns recursos são simulados usando JScript.
     Infelizmente seu navegador desativou a execução de scripts. Por favor ative esse recurso para que esta página seja exibida corretamente.
  </noscript>
<![endif]--> 

Conclusão

Os novos elementos de seção e cabeçalho introduzidos no HTML5 trazem consigo a habilidade de descrever a estrutura de um documento web de modo padronizado. Eles trazem uma grande vantagem para pessoas com navegadores HTML5 e que precisam da estrutura para ajudá-las a entender a página, por exemplo pessoas que utilizam alguma tecnologia assistiva. Esses novos elementos semânticos são simples de usar e, com pouquíssimo trabalho, podem funcionar também em navegadores não-HTML5. Portanto eles devem ser utilizados sem restrição.

{{ HTML5ArticleTOC() }}

{{ languages( {"es": "/es/Secciones_y_esquema_de_un_documento_HTML_5", "ja": "ja/Sections_and_Outlines_of_an_HTML5_document"}) }}

 

Fonte da revisão

<p>A especificação HTML5 traz vários novos elementos aos desenvolvedores web, permitindo-os descrever a estrutura de um documento web com semânticas padronizadas. Este documento descreve esses elementos e como utilizá-los para definir a estrutura desejada para qualquer documento.</p>
<h2 id="Structure_of_a_Document_in_HTML_4">Estrutura de um documento em HTML4</h2>
<p>A estrutura de um documento, ou seja, a estrutura semântica do que está entre <span style="font-family: Courier New;">&lt;body&gt;</span> e <span style="font-family: Courier New;">&lt;/body&gt;</span>, é fundamental para a apresentação da página ao usuário. HTML4 usa a noção de seções e subseções de um documento para descrever sua estrutura. Uma seção é definida por um Elemento HTML de Divisão ({{ HTMLElement("div") }}) com Elementos HTML de Cabeçalho ({{ HTMLElement("h1") }}, {{ HTMLElement("h2") }}, {{ HTMLElement("h3") }}, {{ HTMLElement("h4") }}, {{ HTMLElement("h5") }}, ou {{ HTMLElement("h6") }}) dentro de si, definindo seu título. As relações deses elementos levam à estrutura do documento.</p>
<p>Então a seguinte marcação:</p>
<pre class="brush: html">
&lt;DIV class="section" id="floresta-elefantes" &gt;
&lt;H1&gt;Elefantes-da-floresta&lt;/H1&gt;
&lt;P&gt;Nesta seção, discutiremos os pouco conhecidos elefantes-da-floresta.
<em>...esta seção continua...</em>
&lt;DIV class="subsection" id="floresta-habitat" &gt;
&lt;H2&gt;Habitat&lt;/H2&gt;
&lt;P&gt;Os elefantes-da-floresta não vivem em árvores mas sim entre elas.
<em>...esta subseção continua...</em>
&lt;/DIV&gt;
&lt;/DIV&gt;
</pre>
<p>leva à seguinte estrutura:</p>
<pre>
1. Elefante-da-floresta
   1.1 Habitat
</pre>
<p>Os elementos {{ HTMLElement("div") }} não são obrigatórios para definir uma nova seção. A mera presença de um Elemento de Cabeçalho HTML é suficiente para implicar uma nova seção. Portanto,</p>
<pre class="brush: html">
&lt;H1&gt;Elefante-da-floresta&lt;/H1&gt;
&lt;P&gt;Nesta seção, discutiremos os pouco conhecidos elefantes-da-floresta.
<em>...esta seção continua...</em>
&lt;H2&gt;Habitat&lt;/H2&gt;
&lt;P&gt;Os elefantes-da-floresta não vivem em árvores mas sim entre elas.
<em>...esta subseção continua...</em>
&lt;H2&gt;Dieta&lt;/H2&gt;
&lt;H1&gt;Esquilo-da-mongólia&lt;/H1&gt;
</pre>
<p>leva à:</p>
<pre>
1. Elefante da floresta
   1.1 Habitat
&nbsp;&nbsp; 1.2 Dieta
2. Esquilo-da-mongólia
</pre>
<h2 id="Problems_Solved_by_HTML5">Problemas resolvidos pelo HTML5</h2>
<p>A definição HTML 4 da estrutura de um documento e seu algoritmo de estruturação implícita and leads to numerous problems:</p>
<ol>
  <li>Usage of {{ HTMLElement("div") }} for defining semantic sections, without defining specific values for the <strong>class</strong> attributes makes the automation of the outlining algorithm impossible ("Is that {{ HTMLElement("div") }} part of the outline of the page, defining a section or a subsection?" Or "is it only a presentational {{ HTMLElement("div") }}, only used for styling?"). In other terms, the HTML4 spec is very imprecise on what is a section and how its scope is defined. Automatic generation of outlines is important, especially for <a class="external" href="http://en.wikipedia.org/wiki/Assistive_technology" title="http://en.wikipedia.org/wiki/Assistive_technology">assistive technology</a>, that are likely to adapt the way they present information to the users according to the structure of the document. HTML5 removes the need for {{ HTMLElement("div") }} elements from the outlining algorithm by introducing a new element, {{ HTMLElement("section") }}, the HTML&nbsp;Section Element.</li>
  <li>Merging several documents is hard: inclusion of a sub-document in a main document means changing the level of the HTML Headings Element so that the outline is kept. This is solved in HTML5 as the newly introduced sectioning elements ({{ HTMLElement("article") }}, {{ HTMLElement("section") }}, {{ HTMLElement("nav") }} and {{ HTMLElement("aside") }}) are always subsections of their nearest ancestor section, regardless of what sections are created by internal headings.</li>
  <li>Because each HTML Heading Element is part of the outline, it is not possible to describe a subtitle or secondary title (e.g., <code>&lt;h1&gt;Justine&lt;/h1&gt;&lt;h2&gt;Les Malheurs de la Vertu&lt;/h2&gt;</code> creates the outline <code>1. Justine 1.1 Les Malheurs de la Vertu</code>). HTML5 introduces the {{ HTMLElement("hgroup") }} element that hides all the heading elements except the first one of the highest rank (e.g., <code>&lt;hgroup&gt;&lt;h1&gt;Justine&lt;/h1&gt;&lt;h2&gt;Les Malheurs de la Vertu&lt;/h2&gt;&lt;/hgroup&gt;</code> creates the outline <code>1. Justine</code>).</li>
  <li>In HTML4, every section is part of the document outline. But documents are often not that linear. A document can have special sections containing information that is not part of, though it is related to, the main flow, like an advertisement block or an explanation box. HTML5 introduces the {{ HTMLElement("aside") }} element allowing such sections to not be part of the main outline.</li>
  <li>Again, in HTML4, because every section is part of the document outline, there is no way to have section containing information related not to the document but to the whole site, like logos, menus, table of contents, or copyright information and legal notices. For that purpose, HTML5 introduces three specific sections elements:&nbsp;{{ HTMLElement("nav") }} for collections of links, such as a table of contents, {{ HTMLElement("footer") }} and {{ HTMLElement("header") }} for site-related information.</li>
</ol>
<p>More generally HTML5 brings precision to the sectioning and heading features, allowing document outlines to be predictable and used by the browser to improve the user experience.</p>
<h2 id="The_HTML5_Outline_Algorithm">The HTML5 Outline Algorithm</h2>
<h3 id="Defining_Sections_in_HTML5">Defining Sections in HTML5</h3>
<p>All content lying inside the {{ HTMLElement("body") }} element is part of a section. Sections in HTML5 can be nested. Beside the main section, defined by the {{ HTMLElement("body") }} element, section limits are defined either explicitly or implicitly. Explicitly-defined sections are the content within {{ HTMLElement("body") }},&nbsp; {{ HTMLElement("section") }},&nbsp; {{ HTMLElement("article") }},&nbsp; {{ HTMLElement("aside") }}, {{ HTMLElement("footer") }},&nbsp; {{ HTMLElement("header") }}, and {{ HTMLElement("nav") }} tags.&nbsp;</p>
<div class="note">
  <strong>Note:&nbsp;</strong>Each section can have its own heading hierarchy. Therefore, even a nested section can have an {{ HTMLElement("h1") }}. See <a href="/en/Sections_and_Outlines_of_an_HTML5_document#Defining_Headings_in_HTML5" title="en/Sections_and_Outlines_of_an_HTML5_document#Defining_Headings_in_HTML5">Defining Headings in HTML5</a>.</div>
<p>Example:</p>
<pre class="brush: html">
&lt;section&gt;
&nbsp; &lt;h1&gt;Forest elephants&lt;/h1&gt; 
&nbsp; &lt;section&gt;
&nbsp;&nbsp;&nbsp; &lt;h1&gt;Introduction&lt;/h1&gt;
&nbsp;&nbsp;&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants.
&nbsp; &lt;/section&gt;
&nbsp; &lt;section&gt;
&nbsp;&nbsp;&nbsp; &lt;h1&gt;<span><span>Habitat</span><span>&lt;/</span><span>h1</span><span>&gt;
&nbsp;&nbsp;&nbsp; </span></span><span><span>&lt;</span><span>P</span><span>&gt;</span><span>Forest&nbsp;elephants&nbsp;do&nbsp;not&nbsp;live&nbsp;in&nbsp;trees&nbsp;but&nbsp;among&nbsp;them. 
&nbsp; &lt;/section&gt;
&nbsp; &lt;aside&gt;
&nbsp;&nbsp;&nbsp; &lt;p&gt;advertising block
&nbsp; &lt;/aside&gt;
&lt;/section&gt;
&lt;footer&gt;
&nbsp; &lt;p&gt;(c) 2010 The Example company
&lt;/footer&gt;</span></span> 
</pre>
<p>This HTML&nbsp;snippet defines two top-level sections:</p>
<pre class="brush: html">
<span style=""> &lt;section&gt; &nbsp; 
&nbsp; &lt;h1&gt;Forest elephants&lt;/h1&gt;  &nbsp; 
&nbsp; &lt;section&gt; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;h1&gt;Introduction&lt;/h1&gt; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants.
&nbsp; &lt;/section&gt; &nbsp; 
&nbsp; &lt;section&gt; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;h1&gt;<span><span>Habitat</span><span>&lt;/</span><span>h1</span><span>&gt;
&nbsp;&nbsp;&nbsp; </span></span><span><span>&lt;</span><span>P</span><span>&gt;</span><span>Forest&nbsp;elephants&nbsp;do&nbsp;not&nbsp;live&nbsp;in&nbsp;trees&nbsp;but&nbsp;among&nbsp;them. 
&nbsp; &lt;/section&gt;
 &nbsp; &lt;aside&gt;
&nbsp;&nbsp;&nbsp; &lt;p&gt;advertising block
&nbsp; &lt;/aside&gt;
&lt;/section&gt;
</span><span style="">&lt;footer&gt;
&nbsp; &lt;p&gt;(c) 2010 The Example company
&lt;/footer&gt;</span></span></span></pre>
<p>The first section has three subsections:</p>
<pre class="brush: html">
<span style="">&lt;section&gt;
 &nbsp;&nbsp;&lt;h1&gt;Forest elephants&lt;/h1&gt;
 </span><span style="">&nbsp;&nbsp;&lt;section&gt; &nbsp;&nbsp;&nbsp; 
 &nbsp;&nbsp;&nbsp; &lt;h1&gt;Introduction&lt;/h1&gt; &nbsp;&nbsp;&nbsp; 
 &nbsp;&nbsp;&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants.
 &nbsp; &lt;/section&gt; &nbsp; 
 </span><span style="">&nbsp; &lt;section&gt; &nbsp;&nbsp;&nbsp; 
 &nbsp;&nbsp;&nbsp; &lt;h1&gt;<span><span>Habitat</span><span>&lt;/</span><span>h1</span><span>&gt;
 &nbsp;&nbsp;&nbsp; </span></span><span><span>&lt;</span><span>P</span><span>&gt;</span><span>Forest&nbsp;elephants&nbsp;do&nbsp;not&nbsp;live&nbsp;in&nbsp;trees&nbsp;but&nbsp;among&nbsp;them. 
 &nbsp; &lt;/section&gt;
 &nbsp;</span><span style="">&nbsp;&lt;aside&gt;
 &nbsp;&nbsp;&nbsp; &lt;p&gt;advertising block
 &nbsp; &lt;/aside&gt;
 </span><span style="">&lt;/section&gt;
 &lt;footer&gt;
 &nbsp; &lt;p&gt;(c) 2010 The Example company
 &lt;/footer&gt;</span></span></span></pre>
<p>This leads to the following structure:</p>
<pre>
1. Forest elephants
&nbsp;&nbsp; 1.1 Introduction
&nbsp;&nbsp; 1.2 Habitat
&nbsp;&nbsp; 1.3 Section (aside)
</pre>
<h3 id="Defining_Headings_in_HTML5">Defining Headings in HTML5</h3>
<p>While the HTML Sectioning elements define the structure of the document, an outline also needs headings to be useful. The basic rule is simple: the first HTML heading element (one of {{ HTMLElement("h1") }}, {{ HTMLElement("h2") }}, {{ HTMLElement("h3") }}, {{ HTMLElement("h4") }}, {{ HTMLElement("h5") }}, {{ HTMLElement("h6") }}) defines the heading of the current section.</p>
<p>The heading elements have a <em>rank</em> given by the number in the element name, where {{ HTMLElement("h1") }} has the <em>highest</em> rank, and {{ HTMLElement("h6") }} has the <em>lowest</em> rank. Relative ranking matters only within a section; the structure of the sections determines the outline, not the heading rank of the sections. For example, this code:</p>
<pre class="brush: html">
&lt;section&gt;
&nbsp; &lt;h1&gt;Forest elephants&lt;/h1&gt;&nbsp;&nbsp;&nbsp; 
&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants. 
<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><em>...this section continues...</em>
&nbsp; &lt;section&gt;
&nbsp;&nbsp;&nbsp;&nbsp; &lt;h2&gt;Habitat&lt;/h2&gt;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;Forest elephants do not live in trees but among them.
<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><em>...this subsection continues...</em>
&nbsp; &lt;/section&gt;
&lt;/section&gt;
&lt;section&gt;
&nbsp; &lt;h3&gt;Mongolian gerbils&lt;/h3&gt;
&nbsp; &lt;p&gt;In this section, we discuss the famous mongolian gerbils. 
<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><em>...this section continues...</em>
&lt;/section&gt;
</pre>
<p>leads to the following outline:</p>
<pre>
1. Forest elephants
   1.1 Habitat
2. Mongolian gerbils</pre>
<p>Note that the rank of the heading element (in the example {{ HTMLElement("h1") }} for the first top-level section, {{ HTMLElement("h2") }} for the subsection and {{ HTMLElement("h3") }} for the second top-level section) is not important. (Any rank can be used as the heading of an explicitly-defined section, although this practice is not recommended.)</p>
<h3 id="Implicit_Sectioning">Implicit Sectioning</h3>
<p>Because the HTML5 Sectioning Elements aren't mandatory to define an outline, to keep compatibility with the existing web dominated by HTML4, there is a way to define sections without them. This is called <em>implicit sectioning</em>.</p>
<p>The HTML&nbsp;Headings Elements ({{ HTMLElement("h1") }} to {{ HTMLElement("h6") }}) defines a new, implicit, section when they aren't the first heading of their parent, explicit, sections. The way this implicit section is positioned in the outline is defined by its relative rank with the previous heading in their parent section. If it is of a lower rank than the previous heading, it opens a implicit sub-section of the section. This code:</p>
<pre class="brush: html">
&lt;section&gt;
&nbsp; &lt;h1&gt;Forest elephants&lt;/h1&gt;&nbsp; 
&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants.
<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><em>...this section continues...</em>
&nbsp; &lt;h3 class="implicit subsection"&gt;Habitat&lt;/h3&gt;
&nbsp;&nbsp;&nbsp; &lt;p&gt;Forest elephants do not live in trees but among them.
<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><em>...this subsection continues...</em>
&lt;/section&gt; 
</pre>
<p>leading to the following outline:</p>
<pre>
1. Forest elephants
   1.1 Habitat&nbsp;<em>(implicitly defined by the h3 element)</em>
</pre>
<p>If it is of the same rank as the previous heading, it closes the previous section (which may have been explicit!) and opens a new implicit one at the same level:&nbsp;</p>
<pre class="brush: html">
&lt;section&gt;
&nbsp; &lt;h1&gt;Forest elephants&lt;/h1&gt;&nbsp; 
&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants.
<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><em>...this section continues...</em>
&nbsp; &lt;h1 class="implicit section"&gt;Mongolian gerbils&lt;/h1&gt;
&nbsp; &lt;p&gt;Mongolian gerbils are cute little mammals.
<span style="">&nbsp; &nbsp;&nbsp; </span><em>...this section continues...</em>
&lt;/section&gt;
</pre>
<p>leading to the following outline:&nbsp;</p>
<pre>
1. Forest elephants
2. Mongolian gerbils <em>(implicitly defined by the h1 element, which closed the previous section at the same time)</em>
</pre>
<p>If it is of a higher rank than the previous heading, it closes the previous section and opens a new implicit one at the higher level:</p>
<pre class="brush: html">
&lt;body&gt;
&nbsp; &lt;h1&gt;Mammals&lt;/h1&gt;
&nbsp; &lt;h2&gt;Whales&lt;/h2&gt;
&nbsp; &lt;p&gt;In this section, we discuss the swimming whales.
&nbsp;&nbsp;&nbsp;&nbsp; <em>...this section continues...</em>
&nbsp; &lt;section&gt;
&nbsp;&nbsp;&nbsp; &lt;h3&gt;Forest elephants&lt;/h3&gt;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants.
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<em>...this section continues...</em>
&nbsp;&nbsp;&nbsp; &lt;h3&gt;Mongolian gerbils&lt;/h3&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;Hordes of gerbils have spread their range far beyond Mongolia.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <em>...this subsection continues...</em>
&nbsp;&nbsp;&nbsp; &lt;h2&gt;Reptiles&lt;/h2&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;Reptiles are animals with cold blood.
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <em>...this subsection continues...</em>
&nbsp; &lt;/section&gt;
&lt;/body&gt;  
</pre>
<p>leading to the following outline:</p>
<pre>
1. Mammals
   1.1 Whales <em>(implicitly defined by the h2 element)</em>
   1.2 Forest elephants <em>(explicitly defined by the section element)</em>
   1.3 Mongolian gerbils <em>(implicitly defined by the h3 element, which closes the previous section at the same time)</em>
   1.4 Reptiles <em>(implicitly defined by the h2 element, which closes the previous section at the same time)</em>

</pre>
<p>This is not the outline that one might expect by quickly glancing at the heading tags. To make your markup human-understandable, it is a good practice to use explicit tags for opening and closing sections, and to match the heading rank to the intended section nesting level. However, this is not required by the HTML5 specification. If you find that browsers are rendering your document outline in unexpected ways, check whether you have sections that are implicitly closed by heading elements.</p>
<p>An exception to the rule of thumb that heading rank should match the section nesting level is for sections that may be reused in multiple documents. For example, a section might be stored in a content-management system and assembled into documents at run time. In this case, a good practice is to start at {{ HTMLElement("h1") }} for the top heading level of the reusable section. The nesting level of the reusable section will be determined by the section hierarchy of the document in which it appears. Explicit section tags are still helpful in this case.</p>
<h3 id="Overriding_Implicit_Sectioning">Overriding Implicit Sectioning</h3>
<p>&nbsp;Sometimes, a section needs to have several headings. A few usual cases are:</p>
<ul>
  <li>a section about a book, or a movie, that has a secondary title:
    <pre class="brush: html">
&lt;section&gt;
&nbsp;&nbsp;&lt;h1&gt;Justine&lt;/h1&gt;
&nbsp;&nbsp;&lt;h2&gt;Les Malheurs de la vertu&lt;/h2&gt;
&lt;/section&gt;</pre>
    <p>leads to the following outline:</p>
    <pre>
1. Justine
   1.1 Les Malheurs de la vertu
</pre>
  </li>
  <li>the secondary heading may be used for a tag list:
    <pre class="brush: html">
&lt;section&gt;
&nbsp;&nbsp;&lt;h1&gt;Section and outlines of a document&lt;/h1&gt;
&nbsp;&nbsp;&lt;h2&gt;HTML, HTML5, Sections, Outlines&lt;/h2&gt;
&lt;/section&gt;</pre>
    <p>leads to the following outline:</p>
    <pre>
1. Section and outlines of a document
   1.1 HTML, HTML5, Sections, Outlines</pre>
  </li>
</ul>
<p>Due to the implicit sectioning, this is not possible without the help of the HTML Headings Group Element ({{ HTMLElement("hgroup") }} introduced in HTML5). It hides all headings from the outline, except the first one, allowing an override of the implicit sectioning. With this element the secondary book example:</p>
<pre class="brush: html">
&lt;section&gt;
&nbsp; &lt;hgroup&gt;
&nbsp;&nbsp;&nbsp; &lt;h1&gt;Justine&lt;/h1&gt;
&nbsp;&nbsp;&nbsp; &lt;h2&gt;Les Malheurs de la vertu&lt;/h2&gt;
&nbsp; &lt;/hgroup&gt;
&lt;/section&gt;
</pre>
<p>leads to the following outline:</p>
<pre>
1. Justine
</pre>
<h3 id="Sectioning_roots"><a>Sectioning roots</a></h3>
<p>&nbsp;A sectioning root is an HTML element that can have its own outline, but the sections and headings inside them do not contribute to the outline of their ancestor. Beside {{ HTMLElement("body") }} which is the logical sectioning root of a document, these are often elements that introduce external content to the page:&nbsp;{{ HTMLElement("blockquote") }}, {{ HTMLElement("details") }}, {{ HTMLElement("fieldset") }}, {{ HTMLElement("figure") }} and {{ HTMLElement("td") }}.</p>
<p>Example:</p>
<pre class="brush: html">
&lt;section&gt;
&nbsp; &lt;h1&gt;Forest elephants&lt;/h1&gt; 
&nbsp; &lt;section&gt;
&nbsp;&nbsp;&nbsp; &lt;h2&gt;Introduction&lt;/h2&gt;
&nbsp;&nbsp;&nbsp; &lt;p&gt;In this section, we discuss the lesser known forest elephants
&nbsp; &lt;/section&gt;
&nbsp; &lt;section&gt;
&nbsp;&nbsp;&nbsp; &lt;h2&gt;<span><span>Habitat</span><span>&lt;/</span><span>h2</span><span>&gt;
&nbsp;&nbsp;&nbsp; </span></span><span><span>&lt;</span><span>p</span><span>&gt;</span><span>Forest&nbsp;elephants&nbsp;do not&nbsp;live&nbsp;in&nbsp;trees&nbsp;but&nbsp;among&nbsp;them. Let's
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; look what scientists are saying in "&lt;cite&gt;</span></span><span><span>The Forest Elephant in Borneo</span></span><span><span>&lt;/cite&gt;":
&nbsp;&nbsp;&nbsp; &lt;blockquote&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h1&gt;Borneo
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;The forest element lives in Borneo...
&nbsp;&nbsp;&nbsp; &lt;/blockquote&gt;
&nbsp; &lt;/section&gt;
&lt;/section&gt;</span></span>
</pre>
<p>This example results in the following outline:</p>
<pre>
1. Forest elephants
   1.1 Introduction
&nbsp;&nbsp; 1.2 Habitat
</pre>
<p>This outline doesn't contain the internal outline of the {{ HTMLElement("blockquote") }} element, which, being an external citation, is a sectioning root and isolates its internal outline.</p>
<h3 id="Sections_outside_the_outline">Sections outside the outline</h3>
<p>&nbsp;HTML5 introduces four new elements that allow defining sections that don't belong to the main outline of a web document:</p>
<ol>
  <li>The HTML&nbsp;Aside Section Element ({{ HTMLElement("aside") }}) defines a section that, though related to the main element, doesn't belong to the main flow, like an explanation box or an advertisement. It has its own outline, but doesn't belong to the main one.</li>
  <li>The HTML Navigational Section Element ({{ HTMLElement("nav") }}) defines a section that contains navigation links. There can be several of them in a document, for example, one with page internal links, like a table of content, and another one with site navigational links. These links are not part of the main flow and outline and can be typically initially not rendered by screen reader and similar assistive technology.</li>
  <li>The HTML Header Section Element ({{ HTMLElement("header") }}) defines a page header, typically containing the logo and name of the site and possibly a horizontal menu. Despite its name, it is not necessarily positioned at the beginning of the page.</li>
  <li>The HTML&nbsp;Footer Section Element ({{ HTMLElement("footer") }}) defines a page footer, typically containing the copyright and legal noticed and sometimes some links. Despite its name, it is not necessarily positioned at the bottom of the page.</li>
</ol>
<h2 id="Addresses_and_publication_time_in_sectioning_elements">Addresses and publication time in sectioning elements</h2>
<p>The author of a document often wants to publish some contact information, such the author's name and address. HTML4 allowed this via the {{ HTMLElement("address") }} element, which has been extended in HTML5.</p>
<p>A document can be made of different sections from different authors. A section from another author than the one of the main page is defined using the {{ HTMLElement("article") }} element. Consequently, the {{ HTMLElement("address") }} element is now linked to its nearest {{ HTMLElement("body") }} or {{ HTMLElement("article") }} ancestor.</p>
<p>Similarly, the new HTML5 {{ HTMLElement("time") }} element, with its {{ htmlattrxref("pubdate", "time") }} boolean attribute set, represents the publication date associated to the whole document, respectively to the article, related to its nearest {{ HTMLElement("body") }} or {{ HTMLElement("article") }} ancestor.</p>
<h2 id="Using_HTML5_Elements_in_Non-HTML5_Browsers">Using HTML5 Elements in Non-HTML5 Browsers</h2>
<p>Sections and headings elements should work in most non-HTML5 browsers. Though unsupported, they don't need a special DOM&nbsp;interface and they only need a specific CSS styling as unknown elements are styled as <span style="font-family: Courier New;">display:inline</span> by default:</p>
<pre class="brush: css">
section, article, aside, footer, header, nav, hgroup {
&nbsp; display:block;
}
</pre>
<p>Of course the web developer can style them differently, but keep in mind that in a non-HTML5 browser, the default styling is different from what is expected for such elements. Also note that the {{ HTMLElement("time") }} element has not been included, because the default styling for it in a non-HTML5 browser is the same as the one in an HTML5-compatible one.</p>
<p>This method has its limitation though, as some browsers do not allow styling of unsupported elements. That is the case of the Internet Explorer (version 8 and earlier), which need a specific script to allow this:</p>
<pre class="brush: html">
&lt;!--[if&nbsp;lt IE 9]&gt;
&nbsp; &lt;script&gt;
&nbsp;&nbsp;&nbsp; <code class="js">document.createElement(<span class="js__string">"header"</span> );
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"footer" </span>);
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"section"</span>); 
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"aside"</span>&nbsp; );
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"nav"</span>&nbsp;&nbsp;&nbsp; );
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"article"</span>); 
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"hgroup"</span> );&nbsp;
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"time"</span>&nbsp;&nbsp; );
&nbsp; &lt;/script&gt;
</code><code class="html"><span class="html__ie_style">&lt;![endif]--&gt;</span></code>
</pre>
<p>This script means that, in the case of Internet Explorer (8 and earlier), scripting should be enabled in order to display HTML5 sectioning and headings elements properly. If not, they won't be displayed, which may be problematic as these elements are likely defining the structure of the whole page. That's why an explicit {{ HTMLElement("noscript") }} element should be added for this case:</p>
<pre class="brush: html">
&lt;noscript&gt;
&nbsp;&nbsp; &lt;strong&gt;Warning !&lt;/strong&gt;
&nbsp;&nbsp; Because your browser does not support HTML5, some elements are simulated using JScript.
&nbsp;&nbsp; Unfortunately your browser has disabled scripting. Please enable it in order to display this page.
&lt;/noscript&gt;
</pre>
<p>This leads to the following code to allow the support of the HTML5 sections and headings elements in non-HTML5 browsers, even for Internet Explorer (8 and older), with a proper fallback for the case where this latter browser is configured not to use scripting:</p>
<pre class="brush: html">
&lt;!--[if&nbsp;lt IE 9]&gt;
&nbsp; &lt;script&gt;
&nbsp;&nbsp;&nbsp; <code class="js">document.createElement(<span class="js__string">"header"</span> );
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"footer" </span>);
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"section"</span>); 
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"aside"</span>&nbsp; );
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"nav"</span>&nbsp;&nbsp;&nbsp; );
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"article"</span>); 
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"hgroup"</span> );&nbsp;
&nbsp;&nbsp;&nbsp; document.createElement(<span class="js__string">"time"</span>&nbsp;&nbsp; );
&nbsp; &lt;/script&gt;</code>
<code class="html"><span class="html__ie_style">&nbsp; &lt;noscript&gt;
&nbsp;&nbsp;&nbsp;&nbsp; &lt;strong&gt;Aviso !&lt;/strong&gt;
&nbsp;&nbsp;&nbsp;&nbsp; Seu navegador web não suporta HTML5, e devido a isso alguns recursos são simulados usando JScript.
&nbsp;&nbsp;&nbsp;&nbsp; Infelizmente seu navegador desativou a execução de scripts. Por favor ative esse recurso para que esta página seja exibida corretamente.
&nbsp; &lt;/noscript&gt;</span></code>
<code class="html"><span class="html__ie_style">&lt;![endif]-<span style="font-family: &quot;Courier New&quot;,&quot;Andale Mono&quot;,monospace;">-<span style="font-family: monospace;">&gt;</span></span></span> </code>
</pre>
<h2 id="Conclusion">Conclusão</h2>
<p>Os novos elementos de seção e cabeçalho introduzidos no HTML5 trazem consigo a habilidade de descrever a estrutura de um documento web de modo padronizado. Eles trazem uma grande vantagem para pessoas com navegadores HTML5 e que precisam da estrutura para ajudá-las a entender a página, por exemplo pessoas que utilizam alguma tecnologia assistiva. Esses novos elementos semânticos são simples de usar e, com pouquíssimo trabalho, podem funcionar também em navegadores não-HTML5. Portanto eles devem ser utilizados sem restrição.</p>
<p>{{ HTML5ArticleTOC() }}</p>
<div class="noinclude">
  <p>{{ languages( {"es": "/es/Secciones_y_esquema_de_un_documento_HTML_5", "ja": "ja/Sections_and_Outlines_of_an_HTML5_document"}) }}</p>
</div>
<p>&nbsp;</p>
Reverter para esta revisão