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

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

Webmaster