Annotation of html5/spec/sections.html, revision 1.2

1.1       mike        1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
                      2: <!DOCTYPE html>
                      3: <!-- when publishing, change bits marked ZZZ --><html lang="en-US-x-Hixie" class="split chapter"><head><title>4.4 Sections &#8212; HTML5 </title><style type="text/css">
                      4:    pre { margin-left: 2em; white-space: pre-wrap; }
                      5:    h2 { margin: 3em 0 1em 0; }
                      6:    h3 { margin: 2.5em 0 1em 0; }
                      7:    h4 { margin: 2.5em 0 0.75em 0; }
                      8:    h5, h6 { margin: 2.5em 0 1em; }
                      9:    h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
                     10:    h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
                     11:    p { margin: 1em 0; }
                     12:    hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
                     13:    dl, dd { margin-top: 0; margin-bottom: 0; }
                     14:    dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
                     15:    dt + dt { margin-top: 0; }
                     16:    dd dt { margin-top: 0.25em; margin-bottom: 0; }
                     17:    dd p { margin-top: 0; }
                     18:    dd dl + p { margin-top: 1em; }
                     19:    dd table + p { margin-top: 1em; }
                     20:    p + * > li, dd li { margin: 1em 0; }
                     21:    dt, dfn { font-weight: bold; font-style: normal; }
                     22:    dt dfn { font-style: italic; }
                     23:    pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
                     24:    pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
                     25:    pre em { font-weight: bolder; font-style: normal; }
                     26:    @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
                     27:    var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
                     28:    table { border-collapse: collapse; border-style: hidden hidden none hidden; }
                     29:    table thead, table tbody { border-bottom: solid; }
                     30:    table tbody th:first-child { border-left: solid; }
                     31:    table tbody th { text-align: left; }
                     32:    table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
                     33:    blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
                     34: 
                     35:    .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
                     36:    .matrix, .matrix td { border: none; text-align: right; }
                     37:    .matrix { margin-left: 2em; }
                     38:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                     39:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                     40:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                     41: 
                     42:    .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
                     43:    img.extra { float: right; }
                     44:    pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
                     45:    pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
                     46:    pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
                     47:    pre.css:first-line { color: #AAAA50; }
                     48:    dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
                     49:    hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
                     50:    dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
                     51:    dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
                     52:    dl.domintro dd p { margin: 0.5em 0; }
                     53:    dl.switch { padding-left: 2em; }
                     54:    dl.switch > dt { text-indent: -1.5em; }
                     55:    dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
                     56:    dl.triple { padding: 0 0 0 1em; }
                     57:    dl.triple dt, dl.triple dd { margin: 0; display: inline }
                     58:    dl.triple dt:after { content: ':'; }
                     59:    dl.triple dd:after { content: '\A'; white-space: pre; }
                     60:    .diff-old { text-decoration: line-through; color: silver; background: transparent; }
                     61:    .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
                     62:    a .diff-new { border-bottom: 1px blue solid; }
                     63: 
                     64:    h2 { page-break-before: always; }
                     65:    h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
                     66:    h1 + h2, hr + h2.no-toc { page-break-before: auto; }
                     67: 
                     68:    p > span:not([title=""]):not([class="XXX"]):not([class="impl"]), li > span:not([title=""]):not([class="XXX"]):not([class="impl"]) { border-bottom: solid #9999CC; }
                     69: 
                     70:    div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
                     71:    div.head p { margin: 0; }
                     72:    div.head h1 { margin: 0; }
                     73:    div.head .logo { float: right; margin: 0 1em; }
                     74:    div.head .logo img { border: none } /* remove border from top image */
                     75:    div.head dl { margin: 1em 0; }
                     76:    div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
                     77: 
                     78:    body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
                     79:    body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
                     80:    body > .toc > li > * { margin-bottom: 0.5em; }
                     81:    body > .toc > li > * > li > * { margin-bottom: 0.25em; }
                     82:    .toc, .toc li { list-style: none; }
                     83: 
                     84:    .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
                     85:    .brief li { margin: 0; padding: 0; }
                     86:    .brief li p { margin: 0; padding: 0; }
                     87: 
                     88:    .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
                     89:    .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
                     90:    .category-list li { display: inline; }
                     91:    .category-list li:not(:last-child)::after { content: ', '; }
                     92:    .category-list li > span, .category-list li > a { text-transform: lowercase; }
                     93:    .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */
                     94: 
                     95:    .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
                     96:    .XXX > :first-child { margin-top: 0; }
                     97:    p .XXX { line-height: 3em; }
                     98:    .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
                     99:    .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
                    100:    .annotation :link, .annotation :visited { color: inherit; }
                    101:    .annotation :link:hover, .annotation :visited:hover { background: transparent; }
                    102:    .annotation span { border: none ! important; }
                    103:    .note { color: green; background: transparent; font-family: sans-serif; }
                    104:    .warning { color: red; background: transparent; }
                    105:    .note, .warning { font-weight: bolder; font-style: italic; }
                    106:    p.note, div.note { padding: 0.5em 2em; }
                    107:    span.note { padding: 0 2em; }
                    108:    .note p:first-child, .warning p:first-child { margin-top: 0; }
                    109:    .note p:last-child, .warning p:last-child { margin-bottom: 0; }
                    110:    .warning:before { font-style: normal; }
                    111:    p.note:before { content: 'Note: '; }
                    112:    p.warning:before { content: '\26A0 Warning! '; }
                    113: 
                    114:    .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
                    115:    .bookkeeping { font-size: 0.8em; margin: 2em 0; }
                    116:    .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
                    117: 
                    118:    h4 { position: relative; z-index: 3; }
                    119:    h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
                    120:    .element {
                    121:      background: #EEEEFF;
                    122:      color: black;
                    123:      margin: 0 0 1em 0.15em;
                    124:      padding: 0 1em 0.25em 0.75em;
                    125:      border-left: solid #9999FF 0.25em;
                    126:      position: relative;
                    127:      z-index: 1;
                    128:    }
                    129:    .element:before {
                    130:      position: absolute;
                    131:      z-index: 2;
                    132:      top: 0;
                    133:      left: -1.15em;
                    134:      height: 2em;
                    135:      width: 0.9em;
                    136:      background: #EEEEFF;
                    137:      content: ' ';
                    138:      border-style: none none solid solid;
                    139:      border-color: #9999FF;
                    140:      border-width: 0.25em;
                    141:    }
                    142: 
                    143:    .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
                    144:    td > .example:only-child { margin: 0 0 0 0.1em; }
                    145: 
                    146:    ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
                    147:    ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
                    148:    ul.domTree li li { list-style: none; }
                    149:    ul.domTree li:first-child::before { position: absolute; top: 0; height: 0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
                    150:    ul.domTree li:not(:last-child)::after { position: absolute; top: 0; bottom: -0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
                    151:    ul.domTree span { font-style: italic; font-family: serif; }
                    152:    ul.domTree .t1 code { color: purple; font-weight: bold; }
                    153:    ul.domTree .t2 { font-style: normal; font-family: monospace; }
                    154:    ul.domTree .t2 .name { color: black; font-weight: bold; }
                    155:    ul.domTree .t2 .value { color: blue; font-weight: normal; }
                    156:    ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
                    157:    ul.domTree .t7 code, .domTree .t8 code { color: green; }
                    158:    ul.domTree .t10 code { color: teal; }
                    159: 
                    160:    body.dfnEnabled dfn { cursor: pointer; }
                    161:    .dfnPanel {
                    162:      display: inline;
                    163:      position: absolute;
                    164:      z-index: 10;
                    165:      height: auto;
                    166:      width: auto;
                    167:      padding: 0.5em 0.75em;
                    168:      font: small sans-serif, Droid Sans Fallback;
                    169:      background: #DDDDDD;
                    170:      color: black;
                    171:      border: outset 0.2em;
                    172:    }
                    173:    .dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
                    174:    .dfnPanel :link, .dfnPanel :visited { color: black; }
                    175:    .dfnPanel p { font-weight: bolder; }
                    176:    .dfnPanel * + p { margin-top: 0.25em; }
                    177:    .dfnPanel li { list-style-position: inside; }
                    178: 
                    179:    #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
                    180:    #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
                    181:    #configUI p label { display: block; }
                    182:    #configUI #updateUI, #configUI .loginUI { text-align: center; }
                    183:    #configUI input[type=button] { display: block; margin: auto; }
                    184:   </style><style type="text/css">
                    185: 
                    186:    .applies thead th > * { display: block; }
                    187:    .applies thead code { display: block; }
                    188:    .applies tbody th { whitespace: nowrap; }
                    189:    .applies td { text-align: center; }
                    190:    .applies .yes { background: yellow; }
                    191: 
                    192:    .matrix, .matrix td { border: none; text-align: right; }
                    193:    .matrix { margin-left: 2em; }
                    194: 
                    195:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                    196:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                    197:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                    198: 
                    199:    #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
                    200:    #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
                    201:    #table-example-1 caption { padding-bottom: 0.5em; }
                    202:    #table-example-1 thead, #table-example-1 tbody { border: none; }
                    203:    #table-example-1 th, #table-example-1 td { border: solid thin; }
                    204:    #table-example-1 th { font-weight: normal; }
                    205:    #table-example-1 td { border-style: none solid; vertical-align: top; }
                    206:    #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
                    207:    #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
                    208:    #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
                    209:    #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
                    210:    #table-example-1 tbody td:first-child::after { content: leader(". "); }
                    211:    #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
                    212:    #table-example-1 tbody td:first-child + td { width: 10em; }
                    213:    #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
                    214:    #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
                    215: 
                    216:    .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
                    217:    .apple-table-examples * { font-family: "Times", serif; }
                    218:    .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
                    219:    .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
                    220:    .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
                    221:    .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
                    222:    .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
                    223:    .apple-table-examples td { text-align: right; vertical-align: top; }
                    224:    .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
                    225:    .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
                    226:    .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
                    227:    .apple-table-examples sup { line-height: 0; }
                    228: 
                    229:    .details-example img { vertical-align: top; }
                    230: 
                    231:    #named-character-references-table {
                    232:      font-size: 0.6em;
                    233:      column-width: 28em;
                    234:      column-gap: 1em;
                    235:      -moz-column-width: 28em;
                    236:      -moz-column-gap: 1em;
                    237:      -webkit-column-width: 28em;
                    238:      -webkit-column-gap: 1em;
                    239:    }
                    240:    #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
                    241:    #named-character-references-table > table > tbody > tr > td:last-child:hover > span { position: absolute; top: auto; left: auto; margin-left: 0.5em; line-height: 1.2; font-size: 5em; border: outset; padding: 0.25em 0.5em; background: white; width: 1.25em; height: auto; text-align: center; }
                    242: 
1.2     ! mike      243:    .glyph.control { color: red; }
        !           244: 
1.1       mike      245:   </style><style type="text/css">
                    246:    .domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: black; font-style: italic; border: solid 2px; background: white; padding: 0 0.25em; }
                    247:   </style><link href="data:text/css," id="complete" rel="stylesheet" title="Complete specification"><link href="data:text/css,.impl%20%7B%20display:%20none;%20%7D%0Ahtml%20%7B%20border:%20solid%20yellow;%20%7D%20.domintro:before%20%7B%20display:%20none;%20%7D" id="author" rel="alternate stylesheet" title="Author documentation only"><link href="data:text/css,.impl%20%7B%20background:%20%23FFEEEE;%20%7D%20.domintro:before%20%7B%20background:%20%23FFEEEE;%20%7D" id="highlight" rel="alternate stylesheet" title="Highlight implementation requirements"><script type="text/javascript">
                    248:    function getCookie(name) {
                    249:      var params = location.search.substr(1).split("&");
                    250:      for (var index = 0; index < params.length; index++) {
                    251:        if (params[index] == name)
                    252:          return "1";
                    253:        var data = params[index].split("=");
                    254:        if (data[0] == name)
                    255:          return unescape(data[1]);
                    256:      }
                    257:      var cookies = document.cookie.split("; ");
                    258:      for (var index = 0; index < cookies.length; index++) {
                    259:        var data = cookies[index].split("=");
                    260:        if (data[0] == name)
                    261:          return unescape(data[1]);
                    262:      }
                    263:      return null;
                    264:    }
                    265:    function load(script) {
                    266:      var e = document.createElement('script');
                    267:      e.setAttribute('src', 'http://www.whatwg.org/specs/web-apps/current-work/' + script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
                    268:      document.body.appendChild(e);
                    269:    }
                    270:    function init() {
                    271:      if (location.search == '?slow-browser')
                    272:        return;
                    273:      var configUI = document.createElement('div');
                    274:      configUI.id = 'configUI';
                    275:      document.body.appendChild(configUI);
                    276:      // load('reviewer.js'); // would need cross-site XHR
                    277:      if (document.getElementById('head'))
                    278:        load('toc.js');
                    279:      load('styler.js');
                    280:      // load('updater.js'); // would need cross-site XHR
                    281:      load('dfn.js'); // doesn't support split-out specs, but, oh well.
                    282:      // load('status.js'); // would need cross-site XHR
                    283:      if (getCookie('profile') == '1')
                    284:        document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
                    285:      fixBrokenLink();
                    286:    }
                    287:   </script><link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css">
                    288:   <script src="link-fixup.js"></script>
                    289:   <link href="scripting-1.html" title="4.3 Scripting" rel="prev">
                    290:   <link href="spec.html#contents" title="Table of contents" rel="index">
                    291:   <link href="grouping-content.html" title="4.5 Grouping content" rel="next">
                    292:   </head><body onload="fixBrokenLink(); init()"><div class="head" id="head">
                    293:    <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
                    294:    <h1>HTML5</h1>
                    295:    </div><div>
                    296:    <a href="scripting-1.html">&#8592; 4.3 Scripting</a> &#8211;
                    297:    <a href="spec.html#contents">Table of contents</a> &#8211;
                    298:    <a href="grouping-content.html">4.5 Grouping content &#8594;</a>
                    299:   <ol class="toc"><li><ol><li><a href="sections.html#sections"><span class="secno">4.4 </span>Sections</a>
                    300:     <ol><li><a href="sections.html#the-body-element-0"><span class="secno">4.4.1 </span>The <code>body</code> element</a></li><li><a href="sections.html#the-section-element"><span class="secno">4.4.2 </span>The <code>section</code> element</a></li><li><a href="sections.html#the-nav-element"><span class="secno">4.4.3 </span>The <code>nav</code> element</a></li><li><a href="sections.html#the-article-element"><span class="secno">4.4.4 </span>The <code>article</code> element</a></li><li><a href="sections.html#the-aside-element"><span class="secno">4.4.5 </span>The <code>aside</code> element</a></li><li><a href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements"><span class="secno">4.4.6 </span>The <code>h1</code>, <code>h2</code>,
                    301:   <code>h3</code>, <code>h4</code>,
                    302:   <code>h5</code>, and <code>h6</code>
                    303:   elements</a></li><li><a href="sections.html#the-hgroup-element"><span class="secno">4.4.7 </span>The <code>hgroup</code> element</a></li><li><a href="sections.html#the-header-element"><span class="secno">4.4.8 </span>The <code>header</code> element</a></li><li><a href="sections.html#the-footer-element"><span class="secno">4.4.9 </span>The <code>footer</code> element</a></li><li><a href="sections.html#the-address-element"><span class="secno">4.4.10 </span>The <code>address</code> element</a></li><li><a href="sections.html#headings-and-sections"><span class="secno">4.4.11 </span>Headings and sections</a>
                    304:       <ol><li><a href="sections.html#outlines"><span class="secno">4.4.11.1 </span>Creating an outline</a></li></ol></li></ol></li></ol></li></ol></div>
                    305: 
                    306:   <h3 id="sections"><span class="secno">4.4 </span>Sections</h3><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><h4 id="the-body-element-0"><span class="secno">4.4.1 </span>The <dfn><code>body</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                    307:    <dd><a href="#sectioning-root">Sectioning root</a>.</dd>
                    308:    <dt>Contexts in which this element may be used:</dt>
                    309:    <dd>As the second element in an <code><a href="semantics.html#the-html-element-0">html</a></code> element.</dd>
                    310:    <dt>Content model:</dt>
                    311:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    312:    <dt>Content attributes:</dt>
                    313:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    314:    <dd><code title="handler-window-onafterprint"><a href="webappapis.html#handler-window-onafterprint">onafterprint</a></code></dd>
                    315:    <dd><code title="handler-window-onbeforeprint"><a href="webappapis.html#handler-window-onbeforeprint">onbeforeprint</a></code></dd>
                    316:    <dd><code title="handler-window-onbeforeunload"><a href="webappapis.html#handler-window-onbeforeunload">onbeforeunload</a></code></dd>
                    317:    <dd><code title="handler-window-onblur"><a href="webappapis.html#handler-window-onblur">onblur</a></code></dd>
                    318:    <dd><code title="handler-window-onerror"><a href="webappapis.html#handler-window-onerror">onerror</a></code></dd>
                    319:    <dd><code title="handler-window-onfocus"><a href="webappapis.html#handler-window-onfocus">onfocus</a></code></dd>
                    320:    <dd><code title="handler-window-onhashchange"><a href="webappapis.html#handler-window-onhashchange">onhashchange</a></code></dd>
                    321:    <dd><code title="handler-window-onload"><a href="webappapis.html#handler-window-onload">onload</a></code></dd>
                    322:    <dd><code title="handler-window-onmessage"><a href="webappapis.html#handler-window-onmessage">onmessage</a></code></dd>
                    323:    <dd><code title="handler-window-onoffline"><a href="webappapis.html#handler-window-onoffline">onoffline</a></code></dd>
                    324:    <dd><code title="handler-window-ononline"><a href="webappapis.html#handler-window-ononline">ononline</a></code></dd>
                    325:    <dd><code title="handler-window-onpagehide"><a href="webappapis.html#handler-window-onpagehide">onpagehide</a></code></dd>
                    326:    <dd><code title="handler-window-onpageshow"><a href="webappapis.html#handler-window-onpageshow">onpageshow</a></code></dd>
                    327:    <dd><code title="handler-window-onpopstate"><a href="webappapis.html#handler-window-onpopstate">onpopstate</a></code></dd>
                    328:    <dd><code title="handler-window-onredo"><a href="webappapis.html#handler-window-onredo">onredo</a></code></dd>
                    329:    <dd><code title="handler-window-onresize"><a href="webappapis.html#handler-window-onresize">onresize</a></code></dd>
                    330:    <dd><code title="handler-window-onstorage"><a href="webappapis.html#handler-window-onstorage">onstorage</a></code></dd>
                    331:    <dd><code title="handler-window-onundo"><a href="webappapis.html#handler-window-onundo">onundo</a></code></dd>
                    332:    <dd><code title="handler-window-onunload"><a href="webappapis.html#handler-window-onunload">onunload</a></code></dd>
                    333:    <dt>DOM interface:</dt>
                    334:    <dd>
                    335: <pre class="idl">interface <dfn id="htmlbodyelement">HTMLBodyElement</dfn> : <a href="elements.html#htmlelement">HTMLElement</a> {
                    336:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onafterprint" title="handler-window-onafterprint">onafterprint</a>;
                    337:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onbeforeprint" title="handler-window-onbeforeprint">onbeforeprint</a>;
                    338:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onbeforeunload" title="handler-window-onbeforeunload">onbeforeunload</a>;
                    339:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onblur" title="handler-window-onblur">onblur</a>;
                    340:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onerror" title="handler-window-onerror">onerror</a>;
                    341:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onfocus" title="handler-window-onfocus">onfocus</a>;
                    342:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onhashchange" title="handler-window-onhashchange">onhashchange</a>;
                    343:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onload" title="handler-window-onload">onload</a>;
                    344:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onmessage" title="handler-window-onmessage">onmessage</a>;
                    345:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onoffline" title="handler-window-onoffline">onoffline</a>;
                    346:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-ononline" title="handler-window-ononline">ononline</a>;
                    347:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onpopstate" title="handler-window-onpopstate">onpopstate</a>;
                    348:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onpagehide" title="handler-window-onpagehide">onpagehide</a>;
                    349:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onpageshow" title="handler-window-onpageshow">onpageshow</a>;
                    350:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onredo" title="handler-window-onredo">onredo</a>;
                    351:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onresize" title="handler-window-onresize">onresize</a>;
                    352:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onstorage" title="handler-window-onstorage">onstorage</a>;
                    353:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onundo" title="handler-window-onundo">onundo</a>;
                    354:            attribute <a href="webappapis.html#function">Function</a> <a href="webappapis.html#handler-window-onunload" title="handler-window-onunload">onunload</a>;
                    355: };</pre>
                    356: </dd>
                    357:   </dl><p>The <code><a href="#the-body-element-0">body</a></code> element <a href="rendering.html#represents">represents</a> the main
                    358:   content of the document.</p><p>In conforming documents, there is only one <code><a href="#the-body-element-0">body</a></code>
                    359:   element. The <code title="dom-document-body"><a href="dom.html#dom-document-body">document.body</a></code>
                    360:   IDL attribute provides scripts with easy access to a document's
                    361:   <code><a href="#the-body-element-0">body</a></code> element.</p><div class="impl">
                    362: 
                    363:   <p class="note">Some DOM operations (for example, parts of the
                    364:   <a href="dnd.html#dnd">drag and drop</a> model) are defined in terms of "<a href="dom.html#the-body-element">the
                    365:   body element</a>". This refers to a particular element in the
                    366:   DOM, as per the definition of the term, and not any arbitrary
                    367:   <code><a href="#the-body-element-0">body</a></code> element.</p>
                    368: 
                    369:   </div><p>The <code><a href="#the-body-element-0">body</a></code> element exposes as <a href="webappapis.html#event-handler-content-attributes">event handler
                    370:   content attributes</a> a number of the <a href="webappapis.html#event-handlers">event
                    371:   handlers</a> of the <code><a href="browsers.html#window">Window</a></code> object. It also mirrors
                    372:   their <a href="webappapis.html#event-handler-idl-attributes">event handler IDL attributes</a>.</p><p>The <code title="handler-window-onblur"><a href="webappapis.html#handler-window-onblur">onblur</a></code>, <code title="handler-window-onerror"><a href="webappapis.html#handler-window-onerror">onerror</a></code>, <code title="handler-window-onfocus"><a href="webappapis.html#handler-window-onfocus">onfocus</a></code>, and <code title="handler-window-onload"><a href="webappapis.html#handler-window-onload">onload</a></code> <a href="webappapis.html#event-handlers">event
                    373:   handlers</a> of the <code><a href="browsers.html#window">Window</a></code> object, exposed on the
                    374:   <code><a href="#the-body-element-0">body</a></code> element, shadow the generic <a href="webappapis.html#event-handlers">event
                    375:   handlers</a> with the same names normally supported by <a href="infrastructure.html#html-elements">HTML
                    376:   elements</a>.</p><p class="example">Thus, for example, a bubbling <code title="event-error">error</code> event fired on a child of <a href="dom.html#the-body-element">the
                    377:   body element</a> of a <code><a href="infrastructure.html#document">Document</a></code> would first trigger
                    378:   the <code title="handler-onerror"><a href="webappapis.html#handler-onerror">onerror</a></code> <a href="webappapis.html#event-handler-content-attributes">event handler
                    379:   content attributes</a> of that element, then that of the root
                    380:   <code><a href="semantics.html#the-html-element-0">html</a></code> element, and only <em>then</em> would it trigger
                    381:   the <code title="handler-window-onerror"><a href="webappapis.html#handler-window-onerror">onerror</a></code> <a href="webappapis.html#event-handler-content-attributes" title="event handler content attributes">event handler content
                    382:   attribute</a> on the <code><a href="#the-body-element-0">body</a></code> element. This is because
                    383:   the event would bubble from the target, to the <code><a href="#the-body-element-0">body</a></code>, to
                    384:   the <code><a href="semantics.html#the-html-element-0">html</a></code>, to the <code><a href="infrastructure.html#document">Document</a></code>, to the
                    385:   <code><a href="browsers.html#window">Window</a></code>, and the <a href="webappapis.html#event-handlers" title="event handlers">event
                    386:   handler</a> on the <code><a href="#the-body-element-0">body</a></code> is watching the
                    387:   <code><a href="browsers.html#window">Window</a></code> not the <code><a href="#the-body-element-0">body</a></code>. A regular event
                    388:   listener attached to the <code><a href="#the-body-element-0">body</a></code> using <code title="">addEventListener()</code>, however, would fire when the
                    389:   event bubbled through the <code><a href="#the-body-element-0">body</a></code> and not when it reaches
                    390:   the <code><a href="browsers.html#window">Window</a></code> object.</p><div class="example">
                    391: 
                    392:    <p>This page updates an indicator to show whether or not the user
                    393:    is online:</p>
                    394: 
                    395:    <pre>&lt;!DOCTYPE HTML&gt;
                    396: &lt;html&gt;
                    397:  &lt;head&gt;
                    398:   &lt;title&gt;Online or offline?&lt;/title&gt;
                    399:   &lt;script&gt;
                    400:    function update(online) {
                    401:      document.getElementById('status').textContent =
                    402:        online ? 'Online' : 'Offline';
                    403:    }
                    404:   &lt;/script&gt;
                    405:  &lt;/head&gt;
                    406:  &lt;body ononline="update(true)"
                    407:        onoffline="update(false)"
                    408:        onload="update(navigator.onLine)"&gt;
                    409:   &lt;p&gt;You are: &lt;span id="status"&gt;(Unknown)&lt;/span&gt;&lt;/p&gt;
                    410:  &lt;/body&gt;
                    411: &lt;/html&gt;</pre>
                    412: 
                    413:   </div><h4 id="the-section-element"><span class="secno">4.4.2 </span>The <dfn><code>section</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                    414:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    415:    <dd><a href="content-models.html#sectioning-content">Sectioning content</a>.</dd>
                    416:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                    417:    <dt>Contexts in which this element may be used:</dt>
                    418:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                    419:    <dt>Content model:</dt>
                    420:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    421:    <dt>Content attributes:</dt>
                    422:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    423:    <dt>DOM interface:</dt>
                    424:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                    425:   </dl><p>The <code><a href="#the-section-element">section</a></code> element <a href="rendering.html#represents">represents</a> a
                    426:   generic section of a document or application. A section, in this
                    427:   context, is a thematic grouping of content, typically with a
                    428:   heading.</p><p class="example">Examples of sections would be chapters, the
                    429:   various tabbed pages in a tabbed dialog box, or the numbered
                    430:   sections of a thesis. A Web site's home page could be split into
                    431:   sections for an introduction, news items, contact information.</p><p class="note">Authors are encouraged to use the
                    432:   <code><a href="#the-article-element">article</a></code> element instead of the <code><a href="#the-section-element">section</a></code>
                    433:   element when it would make sense to syndicate the contents of the
                    434:   element.</p><p class="note" id="use-div-for-wrappers">The <code><a href="#the-section-element">section</a></code>
                    435:   element is not a generic container element. When an element is
                    436:   needed for styling purposes or as a convenience for scripting,
                    437:   authors are encouraged to use the <code><a href="grouping-content.html#the-div-element">div</a></code> element
                    438:   instead. A general rule is that the <code><a href="#the-section-element">section</a></code> element is
                    439:   appropriate only if the element's contents would be listed
                    440:   explicitly in the document's <a href="#outline">outline</a>.</p><div class="example">
                    441: 
                    442:    <p>In the following example, we see an article (part of a larger
                    443:    Web page) about apples, containing two short sections.</p>
                    444: 
                    445:    <pre>&lt;article&gt;
                    446:  &lt;hgroup&gt;
                    447:   &lt;h1&gt;Apples&lt;/h1&gt;
                    448:   &lt;h2&gt;Tasty, delicious fruit!&lt;/h2&gt;
                    449:  &lt;/hgroup&gt;
                    450:  &lt;p&gt;The apple is the pomaceous fruit of the apple tree.&lt;/p&gt;
                    451:  &lt;section&gt;
                    452:   &lt;h1&gt;Red Delicious&lt;/h1&gt;
                    453:   &lt;p&gt;These bright red apples are the most common found in many
                    454:   supermarkets.&lt;/p&gt;
                    455:  &lt;/section&gt;
                    456:  &lt;section&gt;
                    457:   &lt;h1&gt;Granny Smith&lt;/h1&gt;
                    458:   &lt;p&gt;These juicy, green apples make a great filling for
                    459:   apple pies.&lt;/p&gt;
                    460:  &lt;/section&gt;
                    461: &lt;/article&gt;</pre>
                    462: 
                    463:    <p>Notice how the use of <code><a href="#the-section-element">section</a></code> means that the author
                    464:    can use <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> elements throughout, without having to
                    465:    worry about whether a particular section is at the top level, the
                    466:    second level, the third level, and so on.</p>
                    467: 
                    468:   </div><div class="example">
                    469: 
                    470:    <p>Here is a graduation programme with two sections, one for the
                    471:    list of people graduating, and one for the description of the
                    472:    ceremony.</p>
                    473: 
                    474:    <pre>&lt;!DOCTYPE Html&gt;
                    475: &lt;Html
                    476:  &gt;&lt;Head
                    477:    &gt;&lt;Title
                    478:      &gt;Graduation Ceremony Summer 2022&lt;/Title
                    479:    &gt;&lt;/Head
                    480:  &gt;&lt;Body
                    481:    &gt;&lt;H1
                    482:      &gt;Graduation&lt;/H1
                    483:    &gt;&lt;Section
                    484:      &gt;&lt;H1
                    485:        &gt;Ceremony&lt;/H1
                    486:      &gt;&lt;P
                    487:        &gt;Opening Procession&lt;/P
                    488:      &gt;&lt;P
                    489:        &gt;Speech by Validactorian&lt;/P
                    490:      &gt;&lt;P
                    491:        &gt;Speech by Class President&lt;/P
                    492:      &gt;&lt;P
                    493:        &gt;Presentation of Diplomas&lt;/P
                    494:      &gt;&lt;P
                    495:        &gt;Closing Speech by Headmaster&lt;/P
                    496:    &gt;&lt;/Section
                    497:    &gt;&lt;Section
                    498:      &gt;&lt;H1
                    499:        &gt;Graduates&lt;/H1
                    500:      &gt;&lt;Ul
                    501:        &gt;&lt;Li
                    502:          &gt;Molly Carpenter&lt;/Li
                    503:        &gt;&lt;Li
                    504:          &gt;Anastasia Luccio&lt;/Li
                    505:        &gt;&lt;Li
                    506:          &gt;Ebenezar McCoy&lt;/Li
                    507:        &gt;&lt;Li
                    508:          &gt;Karrin Murphy&lt;/Li
                    509:        &gt;&lt;Li
                    510:          &gt;Thomas Raith&lt;/Li
                    511:        &gt;&lt;Li
                    512:          &gt;Susan Rodriguez&lt;/Li
                    513:      &gt;&lt;/Ul
                    514:    &gt;&lt;/Section
                    515:  &gt;&lt;/Body
                    516: &gt;&lt;/Html&gt;</pre>
                    517: 
                    518:   </div><h4 id="the-nav-element"><span class="secno">4.4.3 </span>The <dfn><code>nav</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                    519:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    520:    <dd><a href="content-models.html#sectioning-content">Sectioning content</a>.</dd>
                    521:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                    522:    <dt>Contexts in which this element may be used:</dt>
                    523:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                    524:    <dt>Content model:</dt>
                    525:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    526:    <dt>Content attributes:</dt>
                    527:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    528:    <dt>DOM interface:</dt>
                    529:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                    530:   </dl><p>The <code><a href="#the-nav-element">nav</a></code> element <a href="rendering.html#represents">represents</a> a section of
                    531:   a page that links to other pages or to parts within the page: a
                    532:   section with navigation links.</p><p>Not all groups of links on a page need to be in a
                    533:   <code><a href="#the-nav-element">nav</a></code> element &#8212; only sections that consist of major
                    534:   navigation blocks are appropriate for the <code><a href="#the-nav-element">nav</a></code>
                    535:   element. In particular, it is common for footers to have a short
                    536:   list of links to various pages of a site, such as the terms of
                    537:   service, the home page, and a copyright page. The
                    538:   <code><a href="#the-footer-element">footer</a></code> element alone is sufficient for such cases,
                    539:   without a <code><a href="#the-nav-element">nav</a></code> element.</p><p class="note">User agents (such as screen readers) that are
                    540:   targeted at users who can benefit from navigation information being
                    541:   omitted in the initial rendering, or who can benefit from navigation
                    542:   information being immediately available, can use this element as a
                    543:   way to determine what content on the page to initially skip and/or
                    544:   provide on request.</p><div class="example">
                    545: 
                    546:    <p>In the following example, the page has several places where
                    547:    links are present, but only one of those places is considered a
                    548:    navigation section.</p>
                    549: 
                    550:    <pre>&lt;body&gt;
                    551:  &lt;header&gt;
                    552:   &lt;h1&gt;Wake up sheeple!&lt;/h1&gt;
                    553:   &lt;p&gt;&lt;a href="news.html"&gt;News&lt;/a&gt; -
                    554:      &lt;a href="blog.html"&gt;Blog&lt;/a&gt; -
                    555:      &lt;a href="forums.html"&gt;Forums&lt;/a&gt;&lt;/p&gt;
                    556:   &lt;p&gt;Last Modified: &lt;time&gt;2009-04-01&lt;/time&gt;&lt;/p&gt;
                    557:   &lt;nav&gt;
                    558:    &lt;h1&gt;Navigation&lt;/h1&gt;
                    559:    &lt;ul&gt;
                    560:     &lt;li&gt;&lt;a href="articles.html"&gt;Index of all articles&lt;/a&gt;&lt;/li&gt;
                    561:     &lt;li&gt;&lt;a href="today.html"&gt;Things sheeple need to wake up for today&lt;/a&gt;&lt;/li&gt;
                    562:     &lt;li&gt;&lt;a href="successes.html"&gt;Sheeple we have managed to wake&lt;/a&gt;&lt;/li&gt;
                    563:    &lt;/ul&gt;
                    564:   &lt;/nav&gt;
                    565:  &lt;/header&gt;
                    566:  &lt;div&gt;
                    567:   &lt;article&gt;
                    568:    &lt;header&gt;
                    569:     &lt;h1&gt;My Day at the Beach&lt;/h1&gt;
                    570:    &lt;/header&gt;
                    571:    &lt;div&gt;
                    572:     &lt;p&gt;Today I went to the beach and had a lot of fun.&lt;/p&gt;
                    573:     <em>...more content...</em>
                    574:    &lt;/div&gt;
                    575:    &lt;footer&gt;
                    576:     &lt;p&gt;Posted &lt;time pubdate datetime="2009-10-10T14:36-08:00"&gt;Thursday&lt;/time&gt;.&lt;/p&gt;
                    577:    &lt;/footer&gt;
                    578:   &lt;/article&gt;
                    579:   <em>...more blog posts...</em>
                    580:  &lt;/div&gt;
                    581:  &lt;footer&gt;
                    582:   &lt;p&gt;Copyright &#169; 2006 The Example Company&lt;/p&gt;
                    583:   &lt;p&gt;&lt;a href="about.html"&gt;About&lt;/a&gt; -
                    584:      &lt;a href="policy.html"&gt;Privacy Policy&lt;/a&gt; -
                    585:      &lt;a href="contact.html"&gt;Contact Us&lt;/a&gt;&lt;/p&gt;
                    586:  &lt;/footer&gt;
                    587: &lt;/body&gt;</pre>
                    588: 
                    589:    <p>Notice the <code><a href="grouping-content.html#the-div-element">div</a></code> elements being used to wrap all the
                    590:    contents of the page other than the header and footer, and all the
                    591:    contents of the blog entry other than its header and footer.</p>
                    592: 
                    593:   </div><div class="example">
                    594: 
                    595:    <p>In the following example, there are two <code><a href="#the-nav-element">nav</a></code>
                    596:    elements, one for primary navigation around the site, and one for
                    597:    secondary navigation around the page itself.</p>
                    598: 
                    599:    <pre>&lt;body&gt;
                    600:  &lt;h1&gt;The Wiki Center Of Exampland&lt;/h1&gt;
                    601:  &lt;nav&gt;
                    602:   &lt;ul&gt;
                    603:    &lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
                    604:    &lt;li&gt;&lt;a href="/events"&gt;Current Events&lt;/a&gt;&lt;/li&gt;
                    605:    <em>...more...</em>
                    606:   &lt;/ul&gt;
                    607:  &lt;/nav&gt;
                    608:  &lt;article&gt;
                    609:   &lt;header&gt;
                    610:    &lt;h1&gt;Demos in Exampland&lt;/h1&gt;
                    611:    &lt;p&gt;Written by A. N. Other.&lt;/p&gt;
                    612:   &lt;/header&gt;
                    613:   &lt;nav&gt;
                    614:    &lt;ul&gt;
                    615:     &lt;li&gt;&lt;a href="#public"&gt;Public demonstrations&lt;/a&gt;&lt;/li&gt;
                    616:     &lt;li&gt;&lt;a href="#destroy"&gt;Demolitions&lt;/a&gt;&lt;/li&gt;
                    617:     <em>...more...</em>
                    618:    &lt;/ul&gt;
                    619:   &lt;/nav&gt;
                    620:   &lt;div&gt;
                    621:    &lt;section id="public"&gt;
                    622:     &lt;h1&gt;Public demonstrations&lt;/h1&gt;
                    623:     &lt;p&gt;<em>...more...</em>&lt;/p&gt;
                    624:    &lt;/section&gt;
                    625:    &lt;section id="destroy"&gt;
                    626:     &lt;h1&gt;Demolitions&lt;/h1&gt;
                    627:     &lt;p&gt;<em>...more...</em>&lt;/p&gt;
                    628:    &lt;/section&gt;
                    629:    <em>...more...</em>
                    630:   &lt;/div&gt;
                    631:   &lt;footer&gt;
                    632:    &lt;p&gt;&lt;a href="?edit"&gt;Edit&lt;/a&gt; | &lt;a href="?delete"&gt;Delete&lt;/a&gt; | &lt;a href="?Rename"&gt;Rename&lt;/a&gt;&lt;/p&gt;
                    633:   &lt;/footer&gt;
                    634:  &lt;/article&gt;
                    635:  &lt;footer&gt;
                    636:   &lt;p&gt;&lt;small&gt;&#169; copyright 1998 Exampland Emperor&lt;/small&gt;&lt;/p&gt;
                    637:  &lt;/footer&gt;
                    638: &lt;/body&gt;</pre>
                    639: 
                    640:   </div><h4 id="the-article-element"><span class="secno">4.4.4 </span>The <dfn><code>article</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                    641:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    642:    <dd><a href="content-models.html#sectioning-content">Sectioning content</a>.</dd>
                    643:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                    644:    <dt>Contexts in which this element may be used:</dt>
                    645:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                    646:    <dt>Content model:</dt>
                    647:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    648:    <dt>Content attributes:</dt>
                    649:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    650:    <dt>DOM interface:</dt>
                    651:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                    652:   </dl><p>The <code><a href="#the-article-element">article</a></code> element <a href="rendering.html#represents">represents</a> a
                    653:   self-contained composition in a document, page, application, or site
                    654:   and that is intended to be independently distributable or reusable,
                    655:   e.g. in syndication. This could be a forum post, a magazine or
                    656:   newspaper article, a blog entry, a user-submitted comment, an
                    657:   interactive widget or gadget, or any other independent item of
                    658:   content.</p><p>When <code><a href="#the-article-element">article</a></code> elements are nested, the inner
                    659:   <code><a href="#the-article-element">article</a></code> elements represent articles that are in
                    660:   principle related to the contents of the outer article. For
                    661:   instance, a blog entry on a site that accepts user-submitted
                    662:   comments could represent the comments as <code><a href="#the-article-element">article</a></code>
                    663:   elements nested within the <code><a href="#the-article-element">article</a></code> element for the blog
                    664:   entry.</p><p>Author information associated with an <code><a href="#the-article-element">article</a></code>
                    665:   element (q.v. the <code><a href="#the-address-element">address</a></code> element) does not apply to
                    666:   nested <code><a href="#the-article-element">article</a></code> elements.</p><p class="note">When used specifically with content to be
                    667:   redistributed in syndication, the <code><a href="#the-article-element">article</a></code> element is
                    668:   similar in purpose to the <code title="">entry</code> element in
                    669:   Atom. <a href="references.html#refsATOM">[ATOM]</a>
                    670: 
                    671:   </p><p class="note">The <code><a href="text-level-semantics.html#the-time-element">time</a></code> element's <code title="attr-time-pubdate"><a href="text-level-semantics.html#attr-time-pubdate">pubdate</a></code> attribute can be used to
                    672:   provide the publication date for an <code><a href="#the-article-element">article</a></code>
                    673:   element.</p><div class="example" id="article-example">
                    674: 
                    675:    <p>This example shows a blog post using the <code><a href="#the-article-element">article</a></code>
                    676:    element:</p>
                    677: 
                    678:    <pre>&lt;article&gt;
                    679:  &lt;header&gt;
                    680:   &lt;h1&gt;The Very First Rule of Life&lt;/h1&gt;
                    681:   &lt;p&gt;&lt;time pubdate datetime="2009-10-09T14:28-08:00"&gt;&lt;/time&gt;&lt;/p&gt;
                    682:  &lt;/header&gt;
                    683:  &lt;p&gt;If there's a microphone anywhere near you, assume it's hot and
                    684:  sending whatever you're saying to the world. Seriously.&lt;/p&gt;
                    685:  &lt;p&gt;<em>...</em>&lt;/p&gt;
                    686:  &lt;footer&gt;
                    687:   &lt;a href="?comments=1"&gt;Show comments...&lt;/a&gt;
                    688:  &lt;/footer&gt;
                    689: &lt;/article&gt;</pre>
                    690: 
                    691:    <p>Here is that same blog post, but showing some of the comments:</p>
                    692: 
                    693:    <pre>&lt;article&gt;
                    694:  &lt;header&gt;
                    695:   &lt;h1&gt;The Very First Rule of Life&lt;/h1&gt;
                    696:   &lt;p&gt;&lt;time pubdate datetime="2009-10-09T14:28-08:00"&gt;&lt;/time&gt;&lt;/p&gt;
                    697:  &lt;/header&gt;
                    698:  &lt;p&gt;If there's a microphone anywhere near you, assume it's hot and
                    699:  sending whatever you're saying to the world. Seriously.&lt;/p&gt;
                    700:  &lt;p&gt;<em>...</em>&lt;/p&gt;
                    701:  &lt;section&gt;
                    702:   &lt;h1&gt;Comments&lt;/h1&gt;
                    703:   &lt;article&gt;
                    704:    &lt;footer&gt;
                    705:     &lt;p&gt;Posted by: George Washington&lt;/p&gt;
                    706:     &lt;p&gt;&lt;time pubdate datetime="2009-10-10T19:10-08:00"&gt;&lt;/time&gt;&lt;/p&gt;
                    707:    &lt;/footer&gt;
                    708:    &lt;p&gt;Yeah! Especially when talking about your lobbyist friends!&lt;/p&gt;
                    709:   &lt;/article&gt;
                    710:   &lt;article&gt;
                    711:    &lt;footer&gt;
                    712:     &lt;p&gt;Posted by: George Hammond&lt;/p&gt;
                    713:     &lt;p&gt;&lt;time pubdate datetime="2009-10-10T19:15-08:00"&gt;&lt;/time&gt;&lt;/p&gt;
                    714:    &lt;/footer&gt;
                    715:    &lt;p&gt;Hey, you have the same first name as me.&lt;/p&gt;
                    716:   &lt;/article&gt;
                    717:  &lt;/section&gt;
                    718: &lt;/article&gt;</pre>
                    719: 
                    720:    <p>Notice the use of <code><a href="#the-footer-element">footer</a></code> to give the information
                    721:    each comment (such as who wrote it and when): the
                    722:    <code><a href="#the-footer-element">footer</a></code> element <em>can</em> appear at the start of its
                    723:    section when appropriate, such as in this case. (Using
                    724:    <code><a href="#the-header-element">header</a></code> in this case wouldn't be wrong either; it's
                    725:    mostly a matter of authoring preference.)</p>
                    726: 
                    727:   </div><h4 id="the-aside-element"><span class="secno">4.4.5 </span>The <dfn><code>aside</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments. </i><span><a href="http://www.w3.org/html/wg/tracker/issues/91">ISSUE-91</a> (aside) blocks progress to Last Call</span></p><dl class="element"><dt>Categories</dt>
                    728:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    729:    <dd><a href="content-models.html#sectioning-content">Sectioning content</a>.</dd>
                    730:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                    731:    <dt>Contexts in which this element may be used:</dt>
                    732:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                    733:    <dt>Content model:</dt>
                    734:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    735:    <dt>Content attributes:</dt>
                    736:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    737:    <dt>DOM interface:</dt>
                    738:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                    739:   </dl><p>The <code><a href="#the-aside-element">aside</a></code> element <a href="rendering.html#represents">represents</a> a section
                    740:   of a page that consists of content that is tangentially related to
                    741:   the content around the <code><a href="#the-aside-element">aside</a></code> element, and which could
                    742:   be considered separate from that content. Such sections are often
                    743:   represented as sidebars in printed typography.</p><p>The element can be used for typographical effects like pull
                    744:   quotes or sidebars, for advertising, for groups of <code><a href="#the-nav-element">nav</a></code>
                    745:   elements, and for other content that is considered separate from the
                    746:   main content of the page.</p><p class="note">It's not appropriate to use the <code><a href="#the-aside-element">aside</a></code>
                    747:   element just for parentheticals, since those are part of the main
                    748:   flow of the document.</p><div class="example">
                    749: 
                    750:    <p>The following example shows how an aside is used to mark up
                    751:    background material on Switzerland in a much longer news story on
                    752:    Europe.</p>
                    753: 
                    754:    <pre>&lt;aside&gt;
                    755:  &lt;h1&gt;Switzerland&lt;/h1&gt;
                    756:  &lt;p&gt;Switzerland, a land-locked country in the middle of geographic
                    757:  Europe, has not joined the geopolitical European Union, though it is
                    758:  a signatory to a number of European treaties.&lt;/p&gt;
                    759: &lt;/aside&gt;</pre>
                    760: 
                    761:   </div><div class="example">
                    762: 
                    763:    <p>The following example shows how an aside is used to mark up
                    764:    a pull quote in a longer article.</p>
                    765: 
                    766:    <pre>...
                    767: 
                    768: &lt;p&gt;He later joined a large company, continuing on the same work.
                    769: &lt;q&gt;I love my job. People ask me what I do for fun when I'm not at
                    770: work. But I'm paid to do my hobby, so I never know what to
                    771: answer. Some people wonder what they would do if they didn't have to
                    772: work... but I know what I would do, because I was unemployed for a
                    773: year, and I filled that time doing exactly what I do now.&lt;/q&gt;&lt;/p&gt;
                    774: 
                    775: &lt;aside&gt;
                    776:  &lt;q&gt; People ask me what I do for fun when I'm not at work. But I'm
                    777:  paid to do my hobby, so I never know what to answer. &lt;/q&gt;
                    778: &lt;/aside&gt;
                    779: 
                    780: &lt;p&gt;Of course his work &#8212; or should that be hobby? &#8212;
                    781: isn't his only passion. He also enjoys other pleasures.&lt;/p&gt;
                    782: 
                    783: ...</pre>
                    784: 
                    785:   </div><div class="example">
                    786: 
                    787:    <p>The following extract shows how <code><a href="#the-aside-element">aside</a></code> can be used
                    788:    for blogrolls and other side content on a blog:</p>
                    789: 
                    790:    <pre>&lt;body&gt;
                    791:  &lt;header&gt;
                    792:   &lt;h1&gt;My wonderful blog&lt;/h1&gt;
                    793:   &lt;p&gt;My tagline&lt;/p&gt;
                    794:  &lt;/header&gt;
                    795:  &lt;aside&gt;
                    796:   &lt;!-- <em>this aside contains two sections that are tangentially related
                    797:   to the page, namely, links to other blogs, and links to blog posts
                    798:   from this blog</em> --&gt;
                    799:   &lt;nav&gt;
                    800:    &lt;h1&gt;My blogroll&lt;/h1&gt;
                    801:    &lt;ul&gt;
                    802:     &lt;li&gt;&lt;a href="http://blog.example.com/"&gt;Example Blog&lt;/a&gt;
                    803:    &lt;/ul&gt;
                    804:   &lt;/nav&gt;
                    805:   &lt;nav&gt;
                    806:    &lt;h1&gt;Archives&lt;/h1&gt;
                    807:    &lt;ol reversed&gt;
                    808:     &lt;li&gt;&lt;a href="/last-post"&gt;My last post&lt;/a&gt;
                    809:     &lt;li&gt;&lt;a href="/first-post"&gt;My first post&lt;/a&gt;
                    810:    &lt;/ol&gt;
                    811:   &lt;/nav&gt;
                    812:  &lt;/aside&gt;
                    813:  &lt;aside&gt;
                    814:   &lt;!-- <em>this aside is tangentially related to the page also, it
                    815:   contains twitter messages from the blog author</em> --&gt;
                    816:   &lt;h1&gt;Twitter Feed&lt;/h1&gt;
                    817:   &lt;blockquote cite="http://twitter.example.net/t31351234"&gt;
                    818:    I'm on vacation, writing my blog.
                    819:   &lt;/blockquote&gt;
                    820:   &lt;blockquote cite="http://twitter.example.net/t31219752"&gt;
                    821:    I'm going to go on vacation soon.
                    822:   &lt;/blockquote&gt;
                    823:  &lt;/aside&gt;
                    824:  &lt;article&gt;
                    825:   &lt;!-- <em>this is a blog post</em> --&gt;
                    826:   &lt;h1&gt;My last post&lt;/h1&gt;
                    827:   &lt;p&gt;This is my last post.&lt;/p&gt;
                    828:   &lt;footer&gt;
                    829:    &lt;p&gt;&lt;a href="/last-post" rel=bookmark&gt;Permalink&lt;/a&gt;
                    830:   &lt;/footer&gt;
                    831:  &lt;/article&gt;
                    832:  &lt;article&gt;
                    833:   &lt;!-- <em>this is also a blog post</em> --&gt;
                    834:   &lt;h1&gt;My first post&lt;/h1&gt;
                    835:   &lt;p&gt;This is my first post.&lt;/p&gt;
                    836:   &lt;aside&gt;
                    837:    &lt;!-- <em>this aside is about the blog post, since it's inside the
                    838:    &lt;article&gt; element; it would be wrong, for instance, to put the
                    839:    blogroll here, since the blogroll isn't really related to this post
                    840:    specifically, only to the page as a whole</em> --&gt;
                    841:    &lt;h1&gt;Posting&lt;/h1&gt;
                    842:    &lt;p&gt;While I'm thinking about it, I wanted to say something about
                    843:    posting. Posting is fun!&lt;/p&gt;
                    844:   &lt;/aside&gt;
                    845:   &lt;footer&gt;
                    846:    &lt;p&gt;&lt;a href="/first-post" rel=bookmark&gt;Permalink&lt;/a&gt;
                    847:   &lt;/footer&gt;
                    848:  &lt;/article&gt;
                    849:  &lt;footer&gt;
                    850:   &lt;nav&gt;
                    851:    &lt;a href="/archives"&gt;Archives&lt;/a&gt; &#8212;
                    852:    &lt;a href="/about"&gt;About me&lt;/a&gt; &#8212;
                    853:    &lt;a href="/copyright"&gt;Copyright&lt;/a&gt;
                    854:   &lt;/nav&gt;
                    855:  &lt;/footer&gt;
                    856: &lt;/body&gt;</pre>
                    857: 
                    858:   </div><h4 id="the-h1-h2-h3-h4-h5-and-h6-elements"><span class="secno">4.4.6 </span>The <dfn><code>h1</code></dfn>, <dfn><code>h2</code></dfn>,
                    859:   <dfn><code>h3</code></dfn>, <dfn><code>h4</code></dfn>,
                    860:   <dfn><code>h5</code></dfn>, and <dfn><code>h6</code></dfn>
                    861:   elements</h4><dl class="element"><dt>Categories</dt>
                    862:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    863:    <dd><a href="content-models.html#heading-content">Heading content</a>.</dd>
                    864:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                    865:    <dt>Contexts in which this element may be used:</dt>
                    866:    <dd>As a child of an <code><a href="#the-hgroup-element">hgroup</a></code> element.</dd>
                    867:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                    868:    <dt>Content model:</dt>
                    869:    <dd><a href="content-models.html#phrasing-content">Phrasing content</a>.</dd>
                    870:    <dt>Content attributes:</dt>
                    871:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    872:    <dt>DOM interface:</dt>
                    873:    <dd>
                    874:     <pre class="idl">interface <dfn id="htmlheadingelement">HTMLHeadingElement</dfn> : <a href="elements.html#htmlelement">HTMLElement</a> {};</pre>
                    875:    </dd>
                    876:   </dl><p>These elements <a href="rendering.html#represents" title="represents">represent</a> headings
                    877:   for their sections.</p><p>The semantics and meaning of these elements are defined in the
                    878:   section on <a href="#headings-and-sections">headings and sections</a>.</p><p>These elements have a <dfn id="rank">rank</dfn> given by the number in
                    879:   their name. The <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> element is said to have the highest
                    880:   rank, the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> element has the lowest rank, and two
                    881:   elements with the same name have equal rank.</p><div class="example">
                    882: 
                    883:    <p>These two snippets are equivalent:</p>
                    884: 
                    885:    <pre>&lt;body&gt;
                    886: &lt;h1&gt;Let's call it a draw(ing surface)&lt;/h1&gt;
                    887: &lt;h2&gt;Diving in&lt;/h2&gt;
                    888: &lt;h2&gt;Simple shapes&lt;/h2&gt;
                    889: &lt;h2&gt;Canvas coordinates&lt;/h2&gt;
                    890: &lt;h3&gt;Canvas coordinates diagram&lt;/h3&gt;
                    891: &lt;h2&gt;Paths&lt;/h2&gt;
                    892: &lt;/body&gt;</pre>
                    893: 
                    894:    <pre>&lt;body&gt;
                    895:  &lt;h1&gt;Let's call it a draw(ing surface)&lt;/h1&gt;
                    896:  &lt;section&gt;
                    897:   &lt;h1&gt;Diving in&lt;/h1&gt;
                    898:  &lt;/section&gt;
                    899:  &lt;section&gt;
                    900:   &lt;h1&gt;Simple shapes&lt;/h1&gt;
                    901:  &lt;/section&gt;
                    902:  &lt;section&gt;
                    903:   &lt;h1&gt;Canvas coordinates&lt;/h1&gt;
                    904:   &lt;section&gt;
                    905:    &lt;h1&gt;Canvas coordinates diagram&lt;/h1&gt;
                    906:   &lt;/section&gt;
                    907:  &lt;/section&gt;
                    908:  &lt;section&gt;
                    909:   &lt;h1&gt;Paths&lt;/h1&gt;
                    910:  &lt;/section&gt;
                    911: &lt;/body&gt;</pre>
                    912: 
                    913:   </div><h4 id="the-hgroup-element"><span class="secno">4.4.7 </span>The <dfn><code>hgroup</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                    914:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    915:    <dd><a href="content-models.html#heading-content">Heading content</a>.</dd>
                    916:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                    917:    <dt>Contexts in which this element may be used:</dt>
                    918:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                    919:    <dt>Content model:</dt>
                    920:    <dd>One or more <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>, and/or <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements.</dd>
                    921:    <dt>Content attributes:</dt>
                    922:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    923:    <dt>DOM interface:</dt>
                    924:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                    925:   </dl><p>The <code><a href="#the-hgroup-element">hgroup</a></code> element <a href="rendering.html#represents">represents</a> the
                    926:   heading of a section. The element is used to group a set of
                    927:   <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>&#8211;<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements when the heading has
                    928:   multiple levels, such as subheadings, alternative titles, or
                    929:   taglines.</p><p>For the purposes of document summaries, outlines, and the like,
                    930:   the text of <code><a href="#the-hgroup-element">hgroup</a></code> elements is defined to be the text
                    931:   of the highest <a href="#rank" title="rank">ranked</a>
                    932:   <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>&#8211;<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> element descendant of the
                    933:   <code><a href="#the-hgroup-element">hgroup</a></code> element, if there are any such elements, and the
                    934:   first such element if there are multiple elements with that
                    935:   <a href="#rank">rank</a>. If there are no such elements, then the text of
                    936:   the <code><a href="#the-hgroup-element">hgroup</a></code> element is the empty string.</p><p>Other elements of <a href="content-models.html#heading-content">heading content</a> in the
                    937:   <code><a href="#the-hgroup-element">hgroup</a></code> element indicate subheadings or subtitles.</p><p>The <a href="#rank">rank</a> of an <code><a href="#the-hgroup-element">hgroup</a></code> element is the
                    938:   rank of the highest-ranked <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>&#8211;<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>
                    939:   element descendant of the <code><a href="#the-hgroup-element">hgroup</a></code> element, if there are
                    940:   any such elements, or otherwise the same as for an <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>
                    941:   element (the highest rank).</p><p>The section on <a href="#headings-and-sections">headings and sections</a>
                    942:   defines how <code><a href="#the-hgroup-element">hgroup</a></code> elements are assigned to individual
                    943:   sections.</p><div class="example">
                    944: 
                    945:    <p>Here are some examples of valid headings. In each case, the
                    946:    emphasized text represents the text that would be used as the
                    947:    heading in an application extracting heading data and ignoring
                    948:    subheadings.</p>
                    949: 
                    950:    <pre>&lt;hgroup&gt;
                    951:  &lt;h1&gt;<strong>The reality dysfunction</strong>&lt;/h1&gt;
                    952:  &lt;h2&gt;Space is not the only void&lt;/h2&gt;
                    953: &lt;/hgroup&gt;</pre>
                    954: 
                    955:    <pre>&lt;hgroup&gt;
                    956:  &lt;h1&gt;<strong>Dr. Strangelove</strong>&lt;/h1&gt;
                    957:  &lt;h2&gt;Or: How I Learned to Stop Worrying and Love the Bomb&lt;/h2&gt;
                    958: &lt;/hgroup&gt;</pre>
                    959: 
                    960:   <p>The point of using <code><a href="#the-hgroup-element">hgroup</a></code> in these examples is to
                    961:   mask the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> element (which acts as a secondary title)
                    962:   from the <a href="#outline">outline</a> algorithm.</p><!--
                    963:   http://www.brucelawson.co.uk/2009/html-5-is-a-mess/#comment-618895
                    964:   -->
                    965: 
                    966:   </div><h4 id="the-header-element"><span class="secno">4.4.8 </span>The <dfn><code>header</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                    967:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                    968:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                    969:    <dt>Contexts in which this element may be used:</dt>
                    970:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                    971:    <dt>Content model:</dt>
                    972:    <dd><a href="content-models.html#flow-content">Flow content</a>, but with no <code><a href="#the-header-element">header</a></code> or
                    973:    <code><a href="#the-footer-element">footer</a></code> element descendants.</dd>
                    974:    <dt>Content attributes:</dt>
                    975:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                    976:    <dt>DOM interface:</dt>
                    977:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                    978:   </dl><p>The <code><a href="#the-header-element">header</a></code> element <a href="rendering.html#represents">represents</a> a group
                    979:   of introductory or navigational aids.</p><p class="note">A <code><a href="#the-header-element">header</a></code> element is intended to usually
                    980:   contain the section's heading (an
                    981:   <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>&#8211;<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> element or an
                    982:   <code><a href="#the-hgroup-element">hgroup</a></code> element), but this is not required. The
                    983:   <code><a href="#the-header-element">header</a></code> element can also be used to wrap a section's
                    984:   table of contents, a search form, or any relevant logos.</p><div class="example">
                    985: 
                    986:   <p>Here are some sample headers. This first one is for a game:</p>
                    987: 
                    988:    <pre>&lt;header&gt;
                    989:  &lt;p&gt;Welcome to...&lt;/p&gt;
                    990:  &lt;h1&gt;Voidwars!&lt;/h1&gt;
                    991: &lt;/header&gt;</pre>
                    992: 
                    993:    <p>The following snippet shows how the element can be used to mark
                    994:    up a specification's header:</p>
                    995: 
                    996:    <pre>&lt;header&gt;
                    997:  &lt;hgroup&gt;
                    998:   &lt;h1&gt;Scalable Vector Graphics (SVG) 1.2&lt;/h1&gt;
                    999:   &lt;h2&gt;W3C Working Draft 27 October 2004&lt;/h2&gt;
                   1000:  &lt;/hgroup&gt;
                   1001:  &lt;dl&gt;
                   1002:   &lt;dt&gt;This version:&lt;/dt&gt;
                   1003:   &lt;dd&gt;&lt;a href="http://www.w3.org/TR/2004/WD-SVG12-20041027/"&gt;http://www.w3.org/TR/2004/WD-SVG12-20041027/&lt;/a&gt;&lt;/dd&gt;
                   1004:   &lt;dt&gt;Previous version:&lt;/dt&gt;
                   1005:   &lt;dd&gt;&lt;a href="http://www.w3.org/TR/2004/WD-SVG12-20040510/"&gt;http://www.w3.org/TR/2004/WD-SVG12-20040510/&lt;/a&gt;&lt;/dd&gt;
                   1006:   &lt;dt&gt;Latest version of SVG 1.2:&lt;/dt&gt;
                   1007:   &lt;dd&gt;&lt;a href="http://www.w3.org/TR/SVG12/"&gt;http://www.w3.org/TR/SVG12/&lt;/a&gt;&lt;/dd&gt;
                   1008:   &lt;dt&gt;Latest SVG Recommendation:&lt;/dt&gt;
                   1009:   &lt;dd&gt;&lt;a href="http://www.w3.org/TR/SVG/"&gt;http://www.w3.org/TR/SVG/&lt;/a&gt;&lt;/dd&gt;
                   1010:   &lt;dt&gt;Editor:&lt;/dt&gt;
                   1011:   &lt;dd&gt;Dean Jackson, W3C, &lt;a href="mailto:dean@w3.org"&gt;dean@w3.org&lt;/a&gt;&lt;/dd&gt;
                   1012:   &lt;dt&gt;Authors:&lt;/dt&gt;
                   1013:   &lt;dd&gt;See &lt;a href="#authors"&gt;Author List&lt;/a&gt;&lt;/dd&gt;
                   1014:  &lt;/dl&gt;
                   1015:  &lt;p class="copyright"&gt;&lt;a href="http://www.w3.org/Consortium/Legal/ipr-notic <em>...</em>
                   1016: &lt;/header&gt;</pre>
                   1017: 
                   1018:   </div><p class="note">The <code><a href="#the-header-element">header</a></code> element is not
                   1019:   <a href="content-models.html#sectioning-content">sectioning content</a>; it doesn't introduce a new
                   1020:   section.</p><div class="example">
                   1021: 
                   1022:   <p>In this example, the page has a page heading given by the
                   1023:   <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> element, and two subsections whose headings are
                   1024:   given by <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> elements. The content after the
                   1025:   <code><a href="#the-header-element">header</a></code> element is still part of the last subsection
                   1026:   started in the <code><a href="#the-header-element">header</a></code> element, because the
                   1027:   <code><a href="#the-header-element">header</a></code> element doesn't take part in the
                   1028:   <a href="#outline">outline</a> algorithm.</p>
                   1029: 
                   1030:    <pre>&lt;body&gt;
                   1031:  &lt;header&gt;
                   1032:   &lt;h1&gt;Little Green Guys With Guns&lt;/h1&gt;
                   1033:   &lt;nav&gt;
                   1034:    &lt;ul&gt;
                   1035:     &lt;li&gt;&lt;a href="/games"&gt;Games&lt;/a&gt;
                   1036:     &lt;li&gt;&lt;a href="/forum"&gt;Forum&lt;/a&gt;
                   1037:     &lt;li&gt;&lt;a href="/download"&gt;Download&lt;/a&gt;
                   1038:    &lt;/ul&gt;
                   1039:   &lt;/nav&gt;
                   1040:   &lt;h2&gt;Important News&lt;/h2&gt; &lt;!-- this starts a second subsection --&gt;
                   1041:   &lt;!-- this is part of the subsection entitled "Important News" --&gt;
                   1042:   &lt;p&gt;To play today's games you will need to update your client.&lt;/p&gt;
                   1043:   &lt;h2&gt;Games&lt;/h2&gt; &lt;!-- this starts a third subsection --&gt;
                   1044:  &lt;/header&gt;
                   1045:  &lt;p&gt;You have three active games:&lt;/p&gt;
                   1046:  &lt;!-- this is still part of the subsection entitled "Games" --&gt;
                   1047:  ...</pre>
                   1048: 
                   1049:   </div><h4 id="the-footer-element"><span class="secno">4.4.9 </span>The <dfn><code>footer</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                   1050:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                   1051:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                   1052:    <dt>Contexts in which this element may be used:</dt>
                   1053:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                   1054:    <dt>Content model:</dt>
                   1055:    <dd><a href="content-models.html#flow-content">Flow content</a>, but with no <code><a href="#the-header-element">header</a></code> or
                   1056:    <code><a href="#the-footer-element">footer</a></code> element descendants.</dd>
                   1057:    <dt>Content attributes:</dt>
                   1058:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                   1059:    <dt>DOM interface:</dt>
                   1060:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                   1061:   </dl><p>The <code><a href="#the-footer-element">footer</a></code> element <a href="rendering.html#represents">represents</a> a footer
                   1062:   for its nearest ancestor <a href="content-models.html#sectioning-content">sectioning content</a> or
                   1063:   <a href="#sectioning-root">sectioning root</a> element. A footer typically contains
                   1064:   information about its section such as who wrote it, links to related
                   1065:   documents, copyright data, and the like.</p><p class="note">Contact information for the author or editor of a
                   1066:   section belongs in an <code><a href="#the-address-element">address</a></code> element, possibly itself
                   1067:   inside a <code><a href="#the-footer-element">footer</a></code>.</p><p>Footers don't necessarily have to appear at the <em>end</em> of a
                   1068:   section, though they usually do.</p><p>When the <code><a href="#the-footer-element">footer</a></code> element contains entire sections,
                   1069:   they <a href="rendering.html#represents" title="represents">represent</a> appendices, indexes,
                   1070:   long colophons, verbose license agreements, and other such
                   1071:   content.</p><p class="note">The <code><a href="#the-footer-element">footer</a></code> element is not
                   1072:   <a href="content-models.html#sectioning-content">sectioning content</a>; it doesn't introduce a new
                   1073:   section.</p><p>When the nearest ancestor <a href="content-models.html#sectioning-content">sectioning content</a> or
                   1074:   <a href="#sectioning-root">sectioning root</a> element is <a href="dom.html#the-body-element">the body
                   1075:   element</a>, then it applies to the whole page.</p><div class="example">
                   1076: 
                   1077:    <p>Here is a page with two footers, one at the top and one at the
                   1078:    bottom, with the same content:</p>
                   1079: 
                   1080:    <pre>&lt;body&gt;
                   1081:  &lt;footer&gt;&lt;a href="../"&gt;Back to index...&lt;/a&gt;&lt;/footer&gt;
                   1082:  &lt;hgroup&gt;
                   1083:   &lt;h1&gt;Lorem ipsum&lt;/h1&gt;
                   1084:   &lt;h2&gt;The ipsum of all lorems&lt;/h2&gt;
                   1085:  &lt;/hgroup&gt;
                   1086:  &lt;p&gt;A dolor sit amet, consectetur adipisicing elit, sed do eiusmod
                   1087:  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
                   1088:  veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
                   1089:  ea commodo consequat. Duis aute irure dolor in reprehenderit in
                   1090:  voluptate velit esse cillum dolore eu fugiat nulla
                   1091:  pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
                   1092:  culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
                   1093:  &lt;footer&gt;&lt;a href="../"&gt;Back to index...&lt;/a&gt;&lt;/footer&gt;
                   1094: &lt;/body&gt;</pre>
                   1095: 
                   1096:   </div><div class="example">
                   1097: 
                   1098:    <p>Here is an example which shows the <code><a href="#the-footer-element">footer</a></code> element
                   1099:    being used both for a site-wide footer and for a section
                   1100:    footer.</p>
                   1101: 
                   1102:    <pre>&lt;!DOCTYPE HTML&gt;
                   1103: &lt;HTML&gt;&lt;HEAD&gt;
                   1104: &lt;TITLE&gt;The Ramblings of a Scientist&lt;/TITLE&gt;
                   1105: &lt;BODY&gt;
                   1106: &lt;H1&gt;The Ramblings of a Scientist&lt;/H1&gt;
                   1107: &lt;ARTICLE&gt;
                   1108:  &lt;H1&gt;Episode 15&lt;/H1&gt;
                   1109:  &lt;VIDEO SRC="/fm/015.ogv" CONTROLS PRELOAD&gt;
                   1110:   &lt;P&gt;&lt;A HREF="/fm/015.ogv"&gt;Download video&lt;/A&gt;.&lt;/P&gt;
                   1111:  &lt;/VIDEO&gt;
                   1112:  &lt;FOOTER&gt; &lt;!-- footer for article --&gt;
                   1113:   &lt;P&gt;Published &lt;TIME PUBDATE DATETIME="2009-10-21T18:26-07:00"&gt;&lt;/TIME&gt;&lt;/P&gt;
                   1114:  &lt;/FOOTER&gt;
                   1115: &lt;/ARTICLE&gt;
                   1116: &lt;ARTICLE&gt;
                   1117:  &lt;H1&gt;My Favorite Trains&lt;/H1&gt;
                   1118:  &lt;P&gt;I love my trains. My favorite train of all time is a K&#246;f.&lt;/P&gt;
                   1119:  &lt;P&gt;It is fun to see them pull some coal cars because they look so
                   1120:  dwarfed in comparison.&lt;/P&gt;
                   1121:  &lt;FOOTER&gt; &lt;!-- footer for article --&gt;
                   1122:   &lt;P&gt;Published &lt;TIME PUBDATE DATETIME="2009-09-15T14:54-07:00"&gt;&lt;/TIME&gt;&lt;/P&gt;
                   1123:  &lt;/FOOTER&gt;
                   1124: &lt;/ARTICLE&gt;
                   1125: &lt;FOOTER&gt; &lt;!-- site wide footer --&gt;
                   1126:  &lt;NAV&gt;
                   1127:   &lt;P&gt;&lt;A HREF="/credits.html"&gt;Credits&lt;/A&gt; &#8212;
                   1128:      &lt;A HREF="/tos.html"&gt;Terms of Service&lt;/A&gt; &#8212;
                   1129:      &lt;A HREF="/index.html"&gt;Blog Index&lt;/A&gt;&lt;/P&gt;
                   1130:  &lt;/NAV&gt;
                   1131:  &lt;P&gt;Copyright &#169; 2009 Gordon Freeman&lt;/P&gt;
                   1132: &lt;/FOOTER&gt;
                   1133: &lt;/BODY&gt;
                   1134: &lt;/HTML&gt;</pre>
                   1135: 
                   1136:   </div><h4 id="the-address-element"><span class="secno">4.4.10 </span>The <dfn><code>address</code></dfn> element</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><dl class="element"><dt>Categories</dt>
                   1137:    <dd><a href="content-models.html#flow-content">Flow content</a>.</dd>
                   1138:    <dd><a href="dnd.html#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
                   1139:    <dt>Contexts in which this element may be used:</dt>
                   1140:    <dd>Where <a href="content-models.html#flow-content">flow content</a> is expected.</dd>
                   1141:    <dt>Content model:</dt>
                   1142:    <dd><a href="content-models.html#flow-content">Flow content</a>, but with no <a href="content-models.html#heading-content">heading
                   1143:    content</a> descendants, no <a href="content-models.html#sectioning-content">sectioning content</a>
                   1144:    descendants, and no <code><a href="#the-header-element">header</a></code>, <code><a href="#the-footer-element">footer</a></code>, or
                   1145:    <code><a href="#the-address-element">address</a></code> element descendants.</dd>
                   1146:    <dt>Content attributes:</dt>
                   1147:    <dd><a href="elements.html#global-attributes">Global attributes</a></dd>
                   1148:    <dt>DOM interface:</dt>
                   1149:    <dd>Uses <code><a href="elements.html#htmlelement">HTMLElement</a></code>.</dd>
                   1150:   </dl><p>The <code><a href="#the-address-element">address</a></code> element <a href="rendering.html#represents">represents</a> the
                   1151:   contact information for its nearest <code><a href="#the-article-element">article</a></code> or
                   1152:   <code><a href="#the-body-element-0">body</a></code> element ancestor. If that is <a href="dom.html#the-body-element">the body
                   1153:   element</a>, then the contact information applies to the document
                   1154:   as a whole.</p><div class="example">
                   1155:    <p>For example, a page at the W3C Web site related to HTML might
                   1156:    include the following contact information:</p>
                   1157:    <pre>&lt;ADDRESS&gt;
                   1158:  &lt;A href="../People/Raggett/"&gt;Dave Raggett&lt;/A&gt;,
                   1159:  &lt;A href="../People/Arnaud/"&gt;Arnaud Le Hors&lt;/A&gt;,
                   1160:  contact persons for the &lt;A href="Activity"&gt;W3C HTML Activity&lt;/A&gt;
                   1161: &lt;/ADDRESS&gt;</pre>
                   1162:   </div><p>The <code><a href="#the-address-element">address</a></code> element must not be used to represent
                   1163:   arbitrary addresses (e.g. postal addresses), unless those addresses
                   1164:   are in fact the relevant contact information. (The <code><a href="grouping-content.html#the-p-element">p</a></code>
                   1165:   element is the appropriate element for marking up postal addresses
                   1166:   in general.)</p><p>The <code><a href="#the-address-element">address</a></code> element must not contain information
                   1167:   other than contact information.</p><div class="example">
                   1168:    <p>For example, the following is non-conforming use of the
                   1169:    <code><a href="#the-address-element">address</a></code> element:</p>
                   1170:    <pre class="bad">&lt;ADDRESS&gt;Last Modified: 1999/12/24 23:37:50&lt;/ADDRESS&gt;</pre>
                   1171:   </div><p>Typically, the <code><a href="#the-address-element">address</a></code> element would be included
                   1172:   along with other information in a <code><a href="#the-footer-element">footer</a></code> element.</p><div class="impl">
                   1173: 
                   1174:   <p>The contact information for a node <var title="">node</var> is a
                   1175:   collection of <code><a href="#the-address-element">address</a></code> elements defined by the first
                   1176:   applicable entry from the following list:</p>
                   1177: 
                   1178:   <dl class="switch"><dt>If <var title="">node</var> is an <code><a href="#the-article-element">article</a></code> element</dt>
                   1179:    <dt>If <var title="">node</var> is a <code><a href="#the-body-element-0">body</a></code> element</dt>
                   1180: 
                   1181:    <dd>
                   1182: 
                   1183:     <p>The contact information consists of all the
                   1184:     <code><a href="#the-address-element">address</a></code> elements that have <var title="">node</var>
                   1185:     as an ancestor and do not have another <code><a href="#the-body-element-0">body</a></code> or
                   1186:     <code><a href="#the-article-element">article</a></code> element ancestor that is a descendant of <var title="">node</var>.</p>
                   1187: 
                   1188:    </dd>
                   1189: 
                   1190:    <dt>If <var title="">node</var> has an ancestor element that is an <code><a href="#the-article-element">article</a></code> element</dt>
                   1191:    <dt>If <var title="">node</var> has an ancestor element that is a <code><a href="#the-body-element-0">body</a></code> element</dt>
                   1192: 
                   1193:    <dd>
                   1194: 
                   1195:     <p>The contact information of <var title="">node</var> is the same
                   1196:     as the contact information of the nearest <code><a href="#the-article-element">article</a></code> or
                   1197:     <code><a href="#the-body-element-0">body</a></code> element ancestor, whichever is nearest.</p>
                   1198: 
                   1199:    </dd>
                   1200: 
                   1201:    <dt>If <var title="">node</var>'s <code><a href="infrastructure.html#document">Document</a></code> has <a href="dom.html#the-body-element" title="the body element">a body element</a></dt>
                   1202: 
                   1203:    <dd>
                   1204: 
                   1205:     <p>The contact information of <var title="">node</var> is the same
                   1206:     as the contact information <a href="dom.html#the-body-element">the body element</a> of the
                   1207:     <code><a href="infrastructure.html#document">Document</a></code>.</p>
                   1208: 
                   1209:    </dd>
                   1210: 
                   1211:    <dt>Otherwise</dt>
                   1212: 
                   1213:    <dd>
                   1214: 
                   1215:     <p>There is no contact information for <var title="">node</var>.</p>
                   1216: 
                   1217:    </dd>
                   1218: 
                   1219:   </dl><p>User agents may expose the contact information of a node to the
                   1220:   user, or use it for other purposes, such as indexing sections based
                   1221:   on the sections' contact information.</p>
                   1222: 
                   1223:   </div><h4 id="headings-and-sections"><span class="secno">4.4.11 </span><dfn>Headings and sections</dfn></h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><p>The <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>&#8211;<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements and the
                   1224:   <code><a href="#the-hgroup-element">hgroup</a></code> element are headings.</p><p>The first element of <a href="content-models.html#heading-content">heading content</a> in an element
                   1225:   of <a href="content-models.html#sectioning-content">sectioning content</a> <a href="rendering.html#represents">represents</a> the
                   1226:   heading for that section. Subsequent headings of equal or higher
                   1227:   <a href="#rank">rank</a> start new (implied) sections, headings of lower
                   1228:   <a href="#rank">rank</a> start implied subsections that are part of the
                   1229:   previous one. In both cases, the element <a href="rendering.html#represents">represents</a> the
                   1230:   heading of the implied section.</p><p>Certain elements are said to be <dfn id="sectioning-root" title="sectioning
                   1231:   root">sectioning roots</dfn>, including <code><a href="grouping-content.html#the-blockquote-element">blockquote</a></code> and
                   1232:   <code><a href="tabular-data.html#the-td-element">td</a></code> elements. These elements can have their own
                   1233:   outlines, but the sections and headings inside these elements do not
                   1234:   contribute to the outlines of their ancestors.</p><!-- when updating this also update the category index --><ul class="brief category-list"><li><code><a href="grouping-content.html#the-blockquote-element">blockquote</a></code></li>
                   1235:    <li><code><a href="#the-body-element-0">body</a></code></li>
                   1236: <!-- v2DATAGRID   <li><code>datagrid</code></li> -->
                   1237:    <li><code><a href="interactive-elements.html#the-details-element">details</a></code></li>
                   1238:    <li><code><a href="forms.html#the-fieldset-element">fieldset</a></code></li>
                   1239:    <li><code><a href="grouping-content.html#the-figure-element">figure</a></code></li>
                   1240:    <li><code><a href="tabular-data.html#the-td-element">td</a></code></li>
                   1241:   </ul><!-- a root element isn't a sectioning root. This means, for
                   1242:   instance, that you don't get an outline if you just have a random
                   1243:   XML file with <html:h1> elements in it. Other vocabs need to define
                   1244:   what their sectioning root is. --><p><a href="content-models.html#sectioning-content">Sectioning content</a> elements are always considered
                   1245:   subsections of their nearest ancestor <a href="#sectioning-root">sectioning root</a>
                   1246:   or their nearest ancestor element of <a href="content-models.html#sectioning-content">sectioning
                   1247:   content</a>, whichever is nearest, regardless of what implied
                   1248:   sections other headings may have created.</p><div class="example">
                   1249:    <p>For the following fragment:</p>
                   1250:    <pre>&lt;body&gt;
                   1251:  &lt;h1&gt;Foo&lt;/h1&gt;
                   1252:  &lt;h2&gt;Bar&lt;/h2&gt;
                   1253:  &lt;blockquote&gt;
                   1254:   &lt;h3&gt;Bla&lt;/h3&gt;
                   1255:  &lt;/blockquote&gt;
                   1256:  &lt;p&gt;Baz&lt;/p&gt;
                   1257:  &lt;h2&gt;Quux&lt;/h2&gt;
                   1258:  &lt;section&gt;
                   1259:   &lt;h3&gt;Thud&lt;/h3&gt;
                   1260:  &lt;/section&gt;
                   1261:  &lt;p&gt;Grunt&lt;/p&gt;
                   1262: &lt;/body&gt;</pre>
                   1263:    <p>...the structure would be:</p>
                   1264:    <ol><li>
                   1265:      Foo (heading of explicit <code><a href="#the-body-element-0">body</a></code> section, containing the "Grunt" paragraph)
                   1266:      <ol><li>
                   1267:        Bar (heading starting implied section, containing a block quote and the "Baz" paragraph)
                   1268:       </li>
                   1269:       <li>
                   1270:        Quux (heading starting implied section with no content other than the heading itself)
                   1271:       </li>
                   1272:       <li>
                   1273:        Thud (heading of explicit <code><a href="#the-section-element">section</a></code> section)
                   1274:       </li>
                   1275:      </ol></li>
                   1276:    </ol><p>Notice how the <code><a href="#the-section-element">section</a></code> ends the earlier implicit
                   1277:    section so that a later paragraph ("Grunt") is back at the top
                   1278:    level.</p>
                   1279:   </div><p>Sections may contain headings of any <a href="#rank">rank</a>, but
                   1280:   authors are strongly encouraged to either use only <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>
                   1281:   elements, or to use elements of the appropriate <a href="#rank">rank</a>
                   1282:   for the section's nesting level.</p><p>Authors are also encouraged to explicitly wrap sections in
                   1283:   elements of <a href="content-models.html#sectioning-content">sectioning content</a>, instead of relying on
                   1284:   the implicit sections generated by having multiple headings in one
                   1285:   element of <a href="content-models.html#sectioning-content">sectioning content</a>.</p><div class="example">
                   1286:    <p>For example, the following is correct:</p>
                   1287: 
                   1288:    <pre>&lt;body&gt;
                   1289:  &lt;h4&gt;Apples&lt;/h4&gt;
                   1290:  &lt;p&gt;Apples are fruit.&lt;/p&gt;
                   1291:  &lt;section&gt;
                   1292:   &lt;h2&gt;Taste&lt;/h2&gt;
                   1293:   &lt;p&gt;They taste lovely.&lt;/p&gt;
                   1294:   &lt;h6&gt;Sweet&lt;/h6&gt;
                   1295:   &lt;p&gt;Red apples are sweeter than green ones.&lt;/p&gt;
                   1296:   &lt;h1&gt;Color&lt;/h1&gt;
                   1297:   &lt;p&gt;Apples come in various colors.&lt;/p&gt;
                   1298:  &lt;/section&gt;
                   1299: &lt;/body&gt;</pre>
                   1300: 
                   1301:    <p>However, the same document would be more clearly expressed
                   1302:    as:</p>
                   1303: 
                   1304:    <pre>&lt;body&gt;
                   1305:  &lt;h1&gt;Apples&lt;/h1&gt;
                   1306:  &lt;p&gt;Apples are fruit.&lt;/p&gt;
                   1307:  &lt;section&gt;
                   1308:   &lt;h2&gt;Taste&lt;/h2&gt;
                   1309:   &lt;p&gt;They taste lovely.&lt;/p&gt;
                   1310:   &lt;section&gt;
                   1311:    &lt;h3&gt;Sweet&lt;/h3&gt;
                   1312:    &lt;p&gt;Red apples are sweeter than green ones.&lt;/p&gt;
                   1313:   &lt;/section&gt;
                   1314:  &lt;/section&gt;
                   1315:  &lt;section&gt;
                   1316:   &lt;h2&gt;Color&lt;/h2&gt;
                   1317:   &lt;p&gt;Apples come in various colors.&lt;/p&gt;
                   1318:  &lt;/section&gt;
                   1319: &lt;/body&gt;</pre>
                   1320: 
                   1321:    <p>Both of the documents above are semantically identical and would
                   1322:    produce the same outline in compliant user agents.</p>
                   1323: 
                   1324:   </div><h5 id="outlines"><span class="secno">4.4.11.1 </span>Creating an outline</h5><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><div class="impl">
                   1325: 
                   1326:   <!-- v2 idea: It would be nice if there was a way to use this to
                   1327:   autogenerate a table of contents or some such -->
                   1328: 
                   1329:   <p>This section defines an algorithm for creating an outline for a
                   1330:   <a href="content-models.html#sectioning-content">sectioning content</a> element or a <a href="#sectioning-root">sectioning
                   1331:   root</a> element. It is defined in terms of a walk over the nodes
                   1332:   of a DOM tree, in tree order, with each node being visited when it
                   1333:   is <i>entered</i> and when it is <i>exited</i> during the walk.</p>
                   1334: 
                   1335:   </div><p>The <dfn id="outline">outline</dfn> for a <a href="content-models.html#sectioning-content">sectioning content</a>
                   1336:   element or a <a href="#sectioning-root">sectioning root</a> element consists of a list
                   1337:   of one or more potentially nested <a href="#concept-section" title="concept-section">sections</a>. A <dfn id="concept-section" title="concept-section">section</dfn> is a container that
                   1338:   corresponds to some nodes in the original DOM tree. Each section can
                   1339:   have one heading associated with it, and can contain any number of
                   1340:   further nested sections. <span class="impl">The algorithm for the
                   1341:   outline also associates each node in the DOM tree with a particular
                   1342:   section and potentially a heading.</span> (The sections in the
                   1343:   outline aren't <code><a href="#the-section-element">section</a></code> elements, though some may
                   1344:   correspond to such elements &#8212; they are merely conceptual
                   1345:   sections.)</p><div class="example">
                   1346: 
                   1347:    <p>The following markup fragment:</p>
                   1348: 
                   1349:    <pre>&lt;body&gt;
                   1350:  &lt;h1&gt;A&lt;/h1&gt;
                   1351:  &lt;p&gt;B&lt;/p&gt;
                   1352:  &lt;h2&gt;C&lt;/h2&gt;
                   1353:  &lt;p&gt;D&lt;/p&gt;
                   1354:  &lt;h2&gt;E&lt;/h2&gt;
                   1355:  &lt;p&gt;F&lt;/p&gt;
                   1356: &lt;/body&gt;</pre>
                   1357: 
                   1358:    <p>...results in the following outline being created for the
                   1359:    <code><a href="#the-body-element-0">body</a></code> node (and thus the entire document):</p>
                   1360: 
                   1361:    <ol class="brief"><li>
                   1362:      <p>Section created for <code><a href="#the-body-element-0">body</a></code> node.</p>
                   1363:      <p>Associated with heading "A".</p>
                   1364:      <p>Also associated with paragraph "B".</p>
                   1365:      <p>Nested sections:</p>
                   1366:      <ol class="brief"><li>
                   1367:        <p>Section implied for first <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> element.</p>
                   1368:        <p>Associated with heading "C".</p>
                   1369:        <p>Also associated with paragraph "D".</p>
                   1370:        <p>No nested sections.</p>
                   1371:       </li>
                   1372:       <li>
                   1373:        <p>Section implied for second <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> element.</p>
                   1374:        <p>Associated with heading "E".</p>
                   1375:        <p>Also associated with paragraph "F".</p>
                   1376:        <p>No nested sections.</p>
                   1377:       </li>
                   1378:      </ol></li>
                   1379:    </ol></div><div class="impl">
                   1380: 
                   1381:   <p>The algorithm that must be followed during a walk of a DOM
                   1382:   subtree rooted at a <a href="content-models.html#sectioning-content">sectioning content</a> element or a
                   1383:   <a href="#sectioning-root">sectioning root</a> element to determine that element's
                   1384:   <a href="#outline">outline</a> is as follows:</p>
                   1385: 
                   1386:   <ol><li><p>Let <var title="">current outlinee</var> be null. (It holds
                   1387:    the element whose <a href="#outline">outline</a> is being created.)</p></li>
                   1388: 
                   1389:    <li><p>Let <var title="">current section</var> be null. (It holds a
                   1390:    pointer to a <a href="#concept-section" title="concept-section">section</a>, so that
                   1391:    elements in the DOM can all be associated with a section.)</p></li>
                   1392: 
                   1393:    <li><p>Create a stack to hold elements, which is used to handle
                   1394:    nesting. Initialize this stack to empty.</p></li>
                   1395: 
                   1396:    <li>
                   1397: 
                   1398:     <p>As you walk over the DOM in <a href="infrastructure.html#tree-order">tree order</a>, trigger
                   1399:     the first relevant step below for each element as you enter and
                   1400:     exit it.</p>
                   1401: 
                   1402:     <dl class="switch"><dt>If the top of the stack is an element, and you are exiting
                   1403:      that element</dt>
                   1404: 
                   1405:      <dd>
                   1406: 
                   1407:       <p class="note">The element being exited is a <a href="content-models.html#heading-content">heading
                   1408:       content</a> element.</p>
                   1409: 
                   1410:       <p>Pop that element from the stack.</p>
                   1411: 
                   1412:      </dd>
                   1413: 
                   1414: 
                   1415:      <dt>If the top of the stack is a <a href="content-models.html#heading-content">heading content</a>
                   1416:      element</dt>
                   1417: 
                   1418:      <dd><p>Do nothing.</p></dd>
                   1419: 
                   1420: 
                   1421:      <dt>When entering a <a href="content-models.html#sectioning-content">sectioning content</a> element or a
                   1422:      <a href="#sectioning-root">sectioning root</a> element</dt>
                   1423: 
                   1424:      <dd>
                   1425: 
                   1426:       <p>If <var title="">current outlinee</var> is not null, and the
                   1427:       <var title="">current section</var> has no heading, create an
                   1428:       implied heading and let that be the heading for the <var title="">current section</var>.</p>
                   1429: 
                   1430:       <p>If <var title="">current outlinee</var> is not null, push
                   1431:       <var title="">current outlinee</var> onto the stack.</p>
                   1432: 
                   1433:       <p>Let <var title="">current outlinee</var> be the element
                   1434:       that is being entered.</p>
                   1435: 
                   1436:       <p>Let <var title="">current section</var> be a newly created
                   1437:       <a href="#concept-section" title="concept-section">section</a> for the <var title="">current outlinee</var> element.</p>
                   1438: 
                   1439:       <p>Let there be a new <a href="#outline">outline</a> for the new <var title="">current outlinee</var>, initialized with just the new
                   1440:       <var title="">current section</var> as the only <a href="#concept-section" title="concept-section">section</a> in the outline.</p>
                   1441: 
                   1442:      </dd>
                   1443: 
                   1444: 
                   1445:      <dt>When exiting a <a href="content-models.html#sectioning-content">sectioning content</a> element, if
                   1446:      the stack is not empty</dt>
                   1447: 
                   1448:      <dd>
                   1449: 
                   1450:       <p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</p>
                   1451: 
                   1452:       <p>Let <var title="">current section</var> be the last section
                   1453:       in the <a href="#outline">outline</a> of the <var title="">current
                   1454:       outlinee</var> element.</p>
                   1455: 
                   1456:       <p>Append the <a href="#outline">outline</a> of the <a href="content-models.html#sectioning-content">sectioning
                   1457:       content</a> element being exited to the <var title="">current
                   1458:       section</var>. (This does not change which section is the last
                   1459:       section in the <a href="#outline">outline</a>.)</p>
                   1460: 
                   1461:      </dd>
                   1462: 
                   1463: 
                   1464:      <dt>When exiting a <a href="#sectioning-root">sectioning root</a> element, if the
                   1465:      stack is not empty</dt>
                   1466: 
                   1467:      <dd>
                   1468: 
                   1469:       <p>Run these steps:</p>
                   1470: 
                   1471:       <ol><li><p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</p></li>
                   1472: 
                   1473:        <li><p>Let <var title="">current section</var> be the last
                   1474:        section in the <a href="#outline">outline</a> of the <var title="">current
                   1475:        outlinee</var> element.</p></li>
                   1476: 
                   1477:        <li><p><i>Finding the deepest child</i>: If <var title="">current section</var> has no child sections, stop
                   1478:        these steps.</p></li>
                   1479: 
                   1480:        <li><p>Let <var title="">current section</var> be the last
                   1481:        child <a href="#concept-section" title="concept-section">section</a> of the
                   1482:        current <var title="">current section</var>.</p></li>
                   1483: 
                   1484:        <li><p>Go back to the substep labeled <i>finding the deepest
                   1485:        child</i>.</p></li>
                   1486: 
                   1487:       </ol></dd>
                   1488: 
                   1489: 
                   1490:      <dt>When exiting a <a href="content-models.html#sectioning-content">sectioning content</a> element or a
                   1491:      <a href="#sectioning-root">sectioning root</a> element</dt>
                   1492: 
                   1493:      <dd>
                   1494: 
                   1495:       <p class="note">The <var title="">current outlinee</var> is
                   1496:       the element being exited.</p>
                   1497: 
                   1498:       <p>Let <var title="">current section</var> be the first <a href="#concept-section" title="concept-section">section</a> in the
                   1499:       <a href="#outline">outline</a> of the <var title="">current outlinee</var>
                   1500:       element.</p>
                   1501: 
                   1502:       <p>Skip to the next step in the overall set of steps. (The walk
                   1503:       is over.)</p>
                   1504: 
                   1505:      </dd>
                   1506: 
                   1507: 
                   1508:      <dt>If the <var title="">current outlinee</var> is null</dt>
                   1509: 
                   1510:      <dd><p>Do nothing.</p></dd>
                   1511: 
                   1512: 
                   1513:      <dt>When entering a <a href="content-models.html#heading-content">heading content</a> element</dt>
                   1514: 
                   1515:      <dd>
                   1516: 
                   1517:       <p>If the <var title="">current section</var> has no heading,
                   1518:       let the element being entered be the heading for the <var title="">current section</var>.</p>
                   1519: 
                   1520:       <p>Otherwise, if the element being entered has a
                   1521:       <a href="#rank">rank</a> equal to or greater than the heading of the
                   1522:       last section of the <a href="#outline">outline</a> of the <var title="">current outlinee</var>, then create a new <a href="#concept-section" title="concept-section">section</a> and append it to the
                   1523:       <a href="#outline">outline</a> of the <var title="">current outlinee</var>
                   1524:       element, so that this new section is the new last section of
                   1525:       that outline. Let <var title="">current section</var> be that
                   1526:       new section. Let the element being entered be the new heading
                   1527:       for the <var title="">current section</var>.</p>
                   1528: 
                   1529:       <p>Otherwise, run these substeps:</p>
                   1530: 
                   1531:       <ol><li><p>Let <var title="">candidate section</var> be <var title="">current section</var>.</p></li>
                   1532: 
                   1533:        <li><p>If the element being entered has a <a href="#rank">rank</a>
                   1534:        lower than the <a href="#rank">rank</a> of the heading of the <var title="">candidate section</var>, then create a new <a href="#concept-section" title="concept-section">section</a>, and append it to <var title="">candidate section</var>. (This does not change which
                   1535:        section is the last section in the outline.) Let <var title="">current section</var> be this new section. Let the
                   1536:        element being entered be the new heading for the <var title="">current section</var>. Abort these substeps.</p>
                   1537: 
                   1538:        </li><li><p>Let <var title="">new candidate section</var> be the
                   1539:        <a href="#concept-section" title="concept-section">section</a> that contains <var title="">candidate section</var> in the <a href="#outline">outline</a> of
                   1540:        <var title="">current outlinee</var>.</p></li>
                   1541: 
                   1542:        <li><p>Let <var title="">candidate section</var> be <var title="">new candidate section</var>.</p></li>
                   1543: 
                   1544:        <li><p>Return to step 2.</p></li>
                   1545: 
                   1546:       </ol><p>Push the element being entered onto the stack. (This causes
                   1547:       the algorithm to skip any descendants of the element.)</p>
                   1548: 
                   1549:       <p class="note">Recall that <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> has the
                   1550:       <em>highest</em> rank, and <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> has the lowest
                   1551:       rank.</p>
                   1552: 
                   1553:      </dd>
                   1554: 
                   1555: 
                   1556:      <dt>Otherwise</dt>
                   1557: 
                   1558:      <dd><p>Do nothing.</p></dd>
                   1559: 
                   1560:     </dl><p id="associatedSection">In addition, whenever you exit a node,
                   1561:     after doing the steps above, if <var title="">current
                   1562:     section</var> is not null, associate the node with the <a href="#concept-section" title="concept-section">section</a> <var title="">current
                   1563:     section</var>.</p>
                   1564: 
                   1565:    </li>
                   1566: 
                   1567:    <li><p>If the <var title="">current outlinee</var> is null,
                   1568:    then there was no <a href="content-models.html#sectioning-content">sectioning content</a> element or
                   1569:    <a href="#sectioning-root">sectioning root</a> element in the DOM. There is no
                   1570:    <a href="#outline">outline</a>. Abort these steps.</p></li>
                   1571: 
                   1572:    <li><p>Associate any nodes that were not associated with a <a href="#concept-section" title="concept-section">section</a> in the steps above with <var title="">current outlinee</var> as their section.</p></li>
                   1573: 
                   1574:    <li><p>Associate all nodes with the heading of the <a href="#concept-section" title="concept-section">section</a> with which they are
                   1575:    associated, if any.</p></li>
                   1576: 
                   1577:    <li><p>If <var title="">current outlinee</var> is <a href="dom.html#the-body-element">the body
                   1578:    element</a>, then the outline created for that element is the
                   1579:    <a href="#outline">outline</a> of the entire document.</p></li>
                   1580: 
                   1581:   </ol><p>The tree of sections created by the algorithm above, or a proper
                   1582:   subset thereof, must be used when generating document outlines, for
                   1583:   example when generating tables of contents.</p>
                   1584: 
                   1585:   <p>When creating an interactive table of contents, entries should
                   1586:   jump the user to the relevant <a href="content-models.html#sectioning-content">sectioning content</a>
                   1587:   element, if the <a href="#concept-section" title="concept-section">section</a> was
                   1588:   created for a real element in the original document, or to the
                   1589:   relevant <a href="content-models.html#heading-content">heading content</a> element, if the <a href="#concept-section" title="concept-section">section</a> in the tree was generated for
                   1590:   a heading in the above process.</p>
                   1591: 
                   1592:   <p class="note">Selecting the first <a href="#concept-section" title="concept-section">section</a> of the document therefore
                   1593:   always takes the user to the top of the document, regardless of
                   1594:   where the first heading in the <code><a href="#the-body-element-0">body</a></code> is to be found.</p>
                   1595: 
                   1596:   <p>The <dfn id="outline-depth">outline depth</dfn> of a <a href="content-models.html#heading-content">heading content</a>
                   1597:   element associated with a <a href="#concept-section" title="concept-section">section</a> <var title="">section</var>
                   1598:   is the number of <a href="#concept-section" title="concept-section">sections</a> that
                   1599:   are ancestors of <var title="">section</var> in the
                   1600:   <a href="#outline">outline</a> that <var title="">section</var> finds itself
                   1601:   in when the <a href="#outline" title="outline">outlines</a> of its
                   1602:   <code><a href="infrastructure.html#document">Document</a></code>'s elements are created, plus 1. The
                   1603:   <a href="#outline-depth">outline depth</a> of a <a href="content-models.html#heading-content">heading content</a> element
                   1604:   not associated with a <a href="#concept-section" title="concept-section">section</a>
                   1605:   is 1.</p>
                   1606: 
                   1607:   <p>User agents should provide default headings for sections that do
                   1608:   not have explicit section headings.</p>
                   1609: 
                   1610:   <div class="example">
                   1611: 
                   1612:    <p>Consider the following snippet:</p>
                   1613: 
                   1614:    <pre>&lt;body&gt;
                   1615:  &lt;nav&gt;
                   1616:   &lt;p&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/p&gt;
                   1617:  &lt;/nav&gt;
                   1618:  &lt;p&gt;Hello world.&lt;/p&gt;
                   1619:  &lt;aside&gt;
                   1620:   &lt;p&gt;My cat is cute.&lt;/p&gt;
                   1621:  &lt;/aside&gt;
                   1622: &lt;/body&gt;</pre>
                   1623: 
                   1624:    <p>Although it contains no headings, this snippet has three
                   1625:    sections: a document (the <code><a href="#the-body-element-0">body</a></code>) with two subsections
                   1626:    (a <code><a href="#the-nav-element">nav</a></code> and an <code><a href="#the-aside-element">aside</a></code>). A user agent could
                   1627:    present the outline as follows:</p>
                   1628: 
                   1629:    <ol class="brief"><li>Untitled document
                   1630:      <ol><li>Navigation</li>
                   1631:       <li>Sidebar</li>
                   1632:      </ol></li>
                   1633:    </ol><p>These default headings ("Untitled document", "Navigation",
                   1634:    "Sidebar") are not specified by this specification, and might vary
                   1635:    with the user's language, the page's language, the user's
                   1636:    preferences, the user agent implementor's preferences, etc.</p>
                   1637: 
                   1638:   </div>
                   1639: 
                   1640:   <div class="note">
                   1641: 
                   1642:    <p>The following JavaScript function shows how the tree walk could
                   1643:    be implemented. The <var title="">root</var> argument is the root
                   1644:    of the tree to walk, and the <var title="">enter</var> and <var title="">exit</var> arguments are callbacks that are called with
                   1645:    the nodes as they are entered and exited. <a href="references.html#refsECMA262">[ECMA262]</a></p>
                   1646: 
                   1647:    <pre>function (root, enter, exit) {
                   1648:   var node = root;
                   1649:   start: while (node) {
                   1650:     enter(node);
                   1651:     if (node.firstChild) {
                   1652:       node = node.firstChild;
                   1653:       continue start;
                   1654:     }
                   1655:     while (node) {
                   1656:       exit(node);
                   1657:       if (node.nextSibling) {
                   1658:         node = node.nextSibling;
                   1659:         continue start;
                   1660:       }
                   1661:       if (node == root)
                   1662:         node = null;
                   1663:       else
                   1664:         node = node.parentNode;
                   1665:     }
                   1666:   }
                   1667: }</pre>
                   1668: 
                   1669:   </div>
                   1670: 
                   1671:   </div></body></html>

Webmaster