Annotation of html5/spec-author-view/grouping-content.html, revision 1.365

1.356     mike        1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><!-- when publishing, change bits marked ZZZ
                      2:      ZZZ: Set PUB to 1 for TR/ drafts, 0 for dev drafts; PUB-Y lines are used if it's 1 and PUB-N lines if it's 0.
                      3:      ZZZ: Set YEAR, SHORTDAY (month/day), and LONGDAY accordingly. They are used by the INSERT FOO bits below.
                      4:   --><html class="split chapter" lang="en-US-x-Hixie"><meta content="text/html; charset=ascii" http-equiv="Content-Type"><title>4.5 Grouping content &mdash; HTML5 (Edition for Web Authors)</title><meta content="width=device-width;" name="viewport"><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"><link href="whatwg.css" rel="stylesheet"><style type="text/css">
1.12      mike        5:    pre { margin-left: 2em; white-space: pre-wrap; }
                      6:    h2 { margin: 3em 0 1em 0; }
                      7:    h3 { margin: 2.5em 0 1em 0; }
                      8:    h4 { margin: 2.5em 0 0.75em 0; }
                      9:    h5, h6 { margin: 2.5em 0 1em; }
                     10:    h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
                     11:    h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
                     12:    p { margin: 1em 0; }
                     13:    hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
                     14:    dl, dd { margin-top: 0; margin-bottom: 0; }
                     15:    dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
                     16:    dt + dt { margin-top: 0; }
                     17:    dd dt { margin-top: 0.25em; margin-bottom: 0; }
                     18:    dd p { margin-top: 0; }
                     19:    dd dl + p { margin-top: 1em; }
                     20:    dd table + p { margin-top: 1em; }
                     21:    p + * > li, dd li { margin: 1em 0; }
                     22:    dt, dfn { font-weight: bold; font-style: normal; }
                     23:    dt dfn { font-style: italic; }
                     24:    pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
                     25:    pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
                     26:    pre em { font-weight: bolder; font-style: normal; }
                     27:    @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
                     28:    var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
                     29:    table { border-collapse: collapse; border-style: hidden hidden none hidden; }
1.37      mike       30:    table thead, table tbody { border-bottom: solid; }
1.12      mike       31:    table tbody th:first-child { border-left: solid; }
                     32:    table tbody th { text-align: left; }
                     33:    table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
                     34:    blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
                     35: 
                     36:    .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
                     37:    .matrix, .matrix td { border: none; text-align: right; }
                     38:    .matrix { margin-left: 2em; }
                     39:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                     40:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                     41:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                     42: 
                     43:    .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
                     44:    img.extra { float: right; }
                     45:    pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
                     46:    pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
                     47:    pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
                     48:    pre.css:first-line { color: #AAAA50; }
1.21      mike       49:    dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
1.12      mike       50:    hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
                     51:    dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
                     52:    dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
                     53:    dl.domintro dd p { margin: 0.5em 0; }
                     54:    dl.switch { padding-left: 2em; }
                     55:    dl.switch > dt { text-indent: -1.5em; }
                     56:    dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
                     57:    dl.triple { padding: 0 0 0 1em; }
                     58:    dl.triple dt, dl.triple dd { margin: 0; display: inline }
                     59:    dl.triple dt:after { content: ':'; }
                     60:    dl.triple dd:after { content: '\A'; white-space: pre; }
                     61:    .diff-old { text-decoration: line-through; color: silver; background: transparent; }
                     62:    .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
                     63:    a .diff-new { border-bottom: 1px blue solid; }
                     64: 
                     65:    h2 { page-break-before: always; }
                     66:    h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
                     67:    h1 + h2, hr + h2.no-toc { page-break-before: auto; }
                     68: 
1.308     mike       69:    p  > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]),
                     70:    li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), { border-bottom: solid #9999CC; }
1.12      mike       71: 
                     72:    div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
                     73:    div.head p { margin: 0; }
                     74:    div.head h1 { margin: 0; }
                     75:    div.head .logo { float: right; margin: 0 1em; }
                     76:    div.head .logo img { border: none } /* remove border from top image */
                     77:    div.head dl { margin: 1em 0; }
                     78:    div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
                     79: 
                     80:    body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
                     81:    body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
                     82:    body > .toc > li > * { margin-bottom: 0.5em; }
                     83:    body > .toc > li > * > li > * { margin-bottom: 0.25em; }
                     84:    .toc, .toc li { list-style: none; }
                     85: 
                     86:    .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
                     87:    .brief li { margin: 0; padding: 0; }
                     88:    .brief li p { margin: 0; padding: 0; }
                     89: 
                     90:    .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
                     91:    .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
                     92:    .category-list li { display: inline; }
                     93:    .category-list li:not(:last-child)::after { content: ', '; }
                     94:    .category-list li > span, .category-list li > a { text-transform: lowercase; }
                     95:    .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */
                     96: 
                     97:    .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
                     98:    .XXX > :first-child { margin-top: 0; }
                     99:    p .XXX { line-height: 3em; }
                    100:    .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
                    101:    .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
                    102:    .annotation :link, .annotation :visited { color: inherit; }
                    103:    .annotation :link:hover, .annotation :visited:hover { background: transparent; }
                    104:    .annotation span { border: none ! important; }
                    105:    .note { color: green; background: transparent; font-family: sans-serif; }
                    106:    .warning { color: red; background: transparent; }
                    107:    .note, .warning { font-weight: bolder; font-style: italic; }
                    108:    p.note, div.note { padding: 0.5em 2em; }
                    109:    span.note { padding: 0 2em; }
                    110:    .note p:first-child, .warning p:first-child { margin-top: 0; }
                    111:    .note p:last-child, .warning p:last-child { margin-bottom: 0; }
                    112:    .warning:before { font-style: normal; }
                    113:    p.note:before { content: 'Note: '; }
                    114:    p.warning:before { content: '\26A0 Warning! '; }
                    115: 
                    116:    .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
                    117:    .bookkeeping { font-size: 0.8em; margin: 2em 0; }
                    118:    .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
1.135     mike      119:    .bookkeeping dt { margin: 0.5em 2em 0; }
                    120:    .bookkeeping dd { margin: 0 3em 0.5em; }
1.12      mike      121: 
                    122:    h4 { position: relative; z-index: 3; }
                    123:    h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
                    124:    .element {
                    125:      background: #EEEEFF;
                    126:      color: black;
                    127:      margin: 0 0 1em 0.15em;
                    128:      padding: 0 1em 0.25em 0.75em;
                    129:      border-left: solid #9999FF 0.25em;
                    130:      position: relative;
                    131:      z-index: 1;
                    132:    }
                    133:    .element:before {
                    134:      position: absolute;
                    135:      z-index: 2;
                    136:      top: 0;
                    137:      left: -1.15em;
                    138:      height: 2em;
                    139:      width: 0.9em;
                    140:      background: #EEEEFF;
                    141:      content: ' ';
                    142:      border-style: none none solid solid;
                    143:      border-color: #9999FF;
                    144:      border-width: 0.25em;
                    145:    }
                    146: 
                    147:    .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
                    148:    td > .example:only-child { margin: 0 0 0 0.1em; }
                    149: 
                    150:    ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
                    151:    ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
                    152:    ul.domTree li li { list-style: none; }
                    153:    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; }
                    154:    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; }
                    155:    ul.domTree span { font-style: italic; font-family: serif; }
                    156:    ul.domTree .t1 code { color: purple; font-weight: bold; }
                    157:    ul.domTree .t2 { font-style: normal; font-family: monospace; }
                    158:    ul.domTree .t2 .name { color: black; font-weight: bold; }
                    159:    ul.domTree .t2 .value { color: blue; font-weight: normal; }
                    160:    ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
                    161:    ul.domTree .t7 code, .domTree .t8 code { color: green; }
                    162:    ul.domTree .t10 code { color: teal; }
                    163: 
1.15      mike      164:    body.dfnEnabled dfn { cursor: pointer; }
                    165:    .dfnPanel {
                    166:      display: inline;
                    167:      position: absolute;
                    168:      z-index: 10;
                    169:      height: auto;
                    170:      width: auto;
                    171:      padding: 0.5em 0.75em;
                    172:      font: small sans-serif, Droid Sans Fallback;
                    173:      background: #DDDDDD;
                    174:      color: black;
                    175:      border: outset 0.2em;
                    176:    }
                    177:    .dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
                    178:    .dfnPanel :link, .dfnPanel :visited { color: black; }
                    179:    .dfnPanel p { font-weight: bolder; }
                    180:    .dfnPanel * + p { margin-top: 0.25em; }
                    181:    .dfnPanel li { list-style-position: inside; }
                    182: 
1.12      mike      183:    #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
                    184:    #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
                    185:    #configUI p label { display: block; }
                    186:    #configUI #updateUI, #configUI .loginUI { text-align: center; }
                    187:    #configUI input[type=button] { display: block; margin: auto; }
1.124     mike      188: 
1.323     mike      189:    fieldset { margin: 1em; padding: 0.5em 1em; }
                    190:    fieldset > legend + * { margin-top: 0; }
1.295     mike      191:    fieldset > :last-child { margin-bottom: 0; }
1.323     mike      192:    fieldset p { margin: 0.5em 0; }
                    193: 
                    194:    .stability {
                    195:      position: fixed;
                    196:      bottom: 0;
                    197:      left: 0; right: 0;
                    198:      margin: 0 auto 0 auto;
                    199:      width: 50%;
                    200:      background: maroon; color: yellow;
                    201:      -webkit-border-radius: 1em 1em 0 0;
                    202:      -moz-border-radius: 1em 1em 0 0;
                    203:      border-radius: 1em 1em 0 0;
                    204:      -moz-box-shadow: 0 0 1em #500;
                    205:      -webkit-box-shadow: 0 0 1em #500;
                    206:      box-shadow: 0 0 1em red;
                    207:      padding: 0.5em 1em;
                    208:      text-align: center;
                    209:    }
                    210:    .stability strong {
                    211:      display: block;
                    212:    }
1.327     mike      213:    .stability input {
                    214:      appearance: none; margin: 0; border: 0; padding: 0.25em 0.5em; background: transparent; color: black;
                    215:      position: absolute; top: -0.5em; right: 0; font: 1.25em sans-serif; text-align: center;
                    216:    }
                    217:    .stability input:hover {
                    218:      color: white;
                    219:      text-shadow: 0 0 2px black;
                    220:    }
                    221:    .stability input:active {
                    222:      padding: 0.3em 0.45em 0.2em 0.55em;
                    223:    }
1.323     mike      224:    .stability :link, .stability :visited,
                    225:    .stability :link:hover, .stability :visited:hover {
                    226:      background: transparent;
                    227:      color: white;
                    228:    }
1.295     mike      229: 
1.356     mike      230:   </style><link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text/css"><link href="style.css" rel="stylesheet"><script src="link-fixup.js"></script><style type="text/css">
1.12      mike      231: 
                    232:    .applies thead th > * { display: block; }
                    233:    .applies thead code { display: block; }
                    234:    .applies tbody th { whitespace: nowrap; }
                    235:    .applies td { text-align: center; }
                    236:    .applies .yes { background: yellow; }
                    237: 
1.139     mike      238:    .matrix, .matrix td { border: hidden; text-align: right; }
1.12      mike      239:    .matrix { margin-left: 2em; }
                    240: 
                    241:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                    242:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                    243:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                    244: 
1.215     mike      245:    td.eg { border-width: thin; text-align: center; }
                    246: 
1.12      mike      247:    #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
                    248:    #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
                    249:    #table-example-1 caption { padding-bottom: 0.5em; }
                    250:    #table-example-1 thead, #table-example-1 tbody { border: none; }
                    251:    #table-example-1 th, #table-example-1 td { border: solid thin; }
                    252:    #table-example-1 th { font-weight: normal; }
                    253:    #table-example-1 td { border-style: none solid; vertical-align: top; }
                    254:    #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
                    255:    #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
                    256:    #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
                    257:    #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
                    258:    #table-example-1 tbody td:first-child::after { content: leader(". "); }
                    259:    #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
                    260:    #table-example-1 tbody td:first-child + td { width: 10em; }
                    261:    #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
                    262:    #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
                    263: 
                    264:    .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
                    265:    .apple-table-examples * { font-family: "Times", serif; }
                    266:    .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
                    267:    .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
                    268:    .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
                    269:    .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
                    270:    .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
                    271:    .apple-table-examples td { text-align: right; vertical-align: top; }
                    272:    .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
                    273:    .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
                    274:    .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
                    275:    .apple-table-examples sup { line-height: 0; }
                    276: 
1.13      mike      277:    .details-example img { vertical-align: top; }
                    278: 
1.25      mike      279:    #named-character-references-table {
1.259     mike      280:      white-space: nowrap;
1.25      mike      281:      font-size: 0.6em;
1.259     mike      282:      column-width: 30em;
1.25      mike      283:      column-gap: 1em;
1.259     mike      284:      -moz-column-width: 30em;
1.25      mike      285:      -moz-column-gap: 1em;
1.259     mike      286:      -webkit-column-width: 30em;
1.25      mike      287:      -webkit-column-gap: 1em;
                    288:    }
1.259     mike      289:    #named-character-references-table > table > tbody > tr > td:first-child + td,
1.25      mike      290:    #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
                    291:    #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; }
1.259     mike      292:    #named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
1.25      mike      293: 
1.38      mike      294:    .glyph.control { color: red; }
                    295: 
1.41      mike      296:    @font-face {
                    297:      font-family: 'Essays1743';
                    298:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743.ttf');
                    299:    }
                    300:    @font-face {
                    301:      font-family: 'Essays1743';
                    302:      font-weight: bold;
                    303:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Bold.ttf');
                    304:    }
                    305:    @font-face {
                    306:      font-family: 'Essays1743';
                    307:      font-style: italic;
                    308:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Italic.ttf');
                    309:    }
                    310:    @font-face {
                    311:      font-family: 'Essays1743';
                    312:      font-style: italic;
                    313:      font-weight: bold;
                    314:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-BoldItalic.ttf');
                    315:    }
                    316: 
1.24      mike      317:   </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">
1.160     mike      318:  function getCookie(name) {
                    319:    var params = location.search.substr(1).split("&");
                    320:    for (var index = 0; index < params.length; index++) {
                    321:      if (params[index] == name)
                    322:        return "1";
                    323:      var data = params[index].split("=");
                    324:      if (data[0] == name)
                    325:        return unescape(data[1]);
1.12      mike      326:    }
1.160     mike      327:    var cookies = document.cookie.split("; ");
                    328:    for (var index = 0; index < cookies.length; index++) {
                    329:      var data = cookies[index].split("=");
                    330:      if (data[0] == name)
                    331:        return unescape(data[1]);
1.12      mike      332:    }
1.160     mike      333:    return null;
                    334:  }
                    335:  function load(script) {
                    336:    var e = document.createElement('script');
                    337:    e.setAttribute('src', script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
                    338:    document.body.appendChild(e);
                    339:  }
                    340:  function init() {
                    341:    if (location.search == '?slow-browser')
                    342:      return;
                    343:    var configUI = document.createElement('div');
                    344:    configUI.id = 'configUI';
                    345:    document.body.appendChild(configUI);
                    346:    if (document.getElementById('head'))
                    347:      load('toc.js');
                    348:    load('dfn.js');
                    349:    if (getCookie('profile') == '1')
                    350:      document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
                    351:    fixBrokenLink();
                    352:  }
1.356     mike      353: </script><link href="sections.html" rel="prev" title="4.4 Sections">
1.163     mike      354:   <link href="Overview.html#contents" rel="index" title="Table of contents">
                    355:   <link href="text-level-semantics.html" rel="next" title="4.6 Text-level semantics">
                    356:   <body onload="fixBrokenLink(); init()"><div class="head" id="head">
1.12      mike      357:    <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.39      mike      358: 
1.365   ! mike      359:    <h1>HTML5 <span class="edition">Edition for Web Authors</span> <span class="rcsrevision">revision 1.4595</span></h1>
1.12      mike      360:    </div><div>
1.322     mike      361:    <a href="sections.html">&larr; 4.4 Sections</a> &ndash;
1.163     mike      362:    <a href="Overview.html#contents">Table of contents</a> &ndash;
1.322     mike      363:    <a href="text-level-semantics.html">4.6 Text-level semantics &rarr;</a>
1.12      mike      364:   <ol class="toc"><li><ol><li><a href="grouping-content.html#grouping-content"><span class="secno">4.5 </span>Grouping content</a>
1.163     mike      365:     <ol><li><a href="grouping-content.html#the-p-element" id="x4.5.1-the-p-element"><span class="secno">4.5.1 </span>The <code>p</code> element</a><li><a href="grouping-content.html#the-hr-element" id="x4.5.2-the-hr-element"><span class="secno">4.5.2 </span>The <code>hr</code> element</a><li><a href="grouping-content.html#the-pre-element" id="x4.5.3-the-pre-element"><span class="secno">4.5.3 </span>The <code>pre</code> element</a><li><a href="grouping-content.html#the-blockquote-element" id="x4.5.4-the-blockquote-element"><span class="secno">4.5.4 </span>The <code>blockquote</code> element</a><li><a href="grouping-content.html#the-ol-element" id="x4.5.5-the-ol-element"><span class="secno">4.5.5 </span>The <code>ol</code> element</a><li><a href="grouping-content.html#the-ul-element" id="x4.5.6-the-ul-element"><span class="secno">4.5.6 </span>The <code>ul</code> element</a><li><a href="grouping-content.html#the-li-element" id="x4.5.7-the-li-element"><span class="secno">4.5.7 </span>The <code>li</code> element</a><li><a href="grouping-content.html#the-dl-element" id="x4.5.8-the-dl-element"><span class="secno">4.5.8 </span>The <code>dl</code> element</a><li><a href="grouping-content.html#the-dt-element" id="x4.5.9-the-dt-element"><span class="secno">4.5.9 </span>The <code>dt</code> element</a><li><a href="grouping-content.html#the-dd-element" id="x4.5.10-the-dd-element"><span class="secno">4.5.10 </span>The <code>dd</code> element</a><li><a href="grouping-content.html#the-figure-element" id="x4.5.11-the-figure-element"><span class="secno">4.5.11 </span>The <code>figure</code> element</a><li><a href="grouping-content.html#the-figcaption-element" id="x4.5.12-the-figcaption-element"><span class="secno">4.5.12 </span>The <code>figcaption</code> element</a><li><a href="grouping-content.html#the-div-element" id="x4.5.13-the-div-element"><span class="secno">4.5.13 </span>The <code>div</code> element</a></ol></ol></ol></div>
1.12      mike      366: 
1.204     mike      367:   <h3 id="grouping-content"><span class="secno">4.5 </span>Grouping content</h3><h4 id="the-p-element"><span class="secno">4.5.1 </span>The <dfn><code>p</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike      368:    <dd><a href="content-models.html#flow-content" id="flow-content-40">Flow content</a>.</dd>
1.159     mike      369:    <dd><a href="dnd.html#formatblock-candidate" id="formatblock-candidate-9"><code title="">formatBlock</code> candidate</a>.</dd>
1.205     mike      370:    <dt>Contexts in which this element can be used:</dt>
                    371:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-41">flow content</a> is expected.</dd>
1.12      mike      372:    <dt>Content model:</dt>
1.365   ! mike      373:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-24">Phrasing content</a>.</dd>
1.12      mike      374:    <dt>Content attributes:</dt>
1.159     mike      375:    <dd><a href="elements.html#global-attributes" id="global-attributes-19">Global attributes</a></dd>
1.12      mike      376:    <dt>DOM interface:</dt>
                    377:    <dd>
1.159     mike      378:     <pre class="idl">interface <dfn id="htmlparagraphelement">HTMLParagraphElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-26">HTMLElement</a> {};</pre>
1.12      mike      379:    </dd>
1.365   ! mike      380:   </dl><p>The <code><a href="#the-p-element" id="p-14">p</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a
1.189     mike      381:   <a href="content-models.html#paragraph" id="paragraph-5">paragraph</a>.<p class="note">While paragraphs are usually represented in visual
                    382:   media by blocks of text that are physically separated from adjacent
                    383:   blocks through blank lines, a style sheet or user agent would be
                    384:   equally justified in presenting paragraph breaks in a different
                    385:   manner, for instance using inline pilcrows (&para;).<div class="example">
1.12      mike      386:    <p>The following examples are conforming HTML fragments:</p>
                    387:    <pre>&lt;p&gt;The little kitten gently seated himself on a piece of
                    388: carpet. Later in his life, this would be referred to as the time the
                    389: cat sat on the mat.&lt;/p&gt;</pre>
                    390:    <pre>&lt;fieldset&gt;
                    391:  &lt;legend&gt;Personal information&lt;/legend&gt;
                    392:  &lt;p&gt;
                    393:    &lt;label&gt;Name: &lt;input name="n"&gt;&lt;/label&gt;
                    394:    &lt;label&gt;&lt;input name="anon" type="checkbox"&gt; Hide from other users&lt;/label&gt;
                    395:  &lt;/p&gt;
                    396:  &lt;p&gt;&lt;label&gt;Address: &lt;textarea name="a"&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
                    397: &lt;/fieldset&gt;</pre>
                    398:    <pre>&lt;p&gt;There was once an example from Femley,&lt;br&gt;
                    399: Whose markup was of dubious quality.&lt;br&gt;
                    400: The validator complained,&lt;br&gt;
                    401: So the author was pained,&lt;br&gt;
                    402: To move the error from the markup to the rhyming.&lt;/p&gt;</pre>
1.365   ! mike      403:   </div><p>The <code><a href="#the-p-element" id="p-15">p</a></code> element should not be used when a more
1.163     mike      404:   specific element is more appropriate.<div class="example">
1.12      mike      405: 
                    406:    <p>The following example is technically correct:</p>
                    407: 
                    408: <pre>&lt;section&gt;
                    409:  &lt;!-- ... --&gt;
                    410:  &lt;p&gt;Last modified: 2001-04-23&lt;/p&gt;
                    411:  &lt;p&gt;Author: fred@example.com&lt;/p&gt;
                    412: &lt;/section&gt;</pre>
                    413: 
                    414:    <p>However, it would be better marked-up as:</p>
                    415: 
                    416: <pre>&lt;section&gt;
                    417:  &lt;!-- ... --&gt;
                    418:  &lt;footer&gt;Last modified: 2001-04-23&lt;/footer&gt;
                    419:  &lt;address&gt;Author: fred@example.com&lt;/address&gt;
                    420: &lt;/section&gt;</pre>
                    421: 
                    422:    <p>Or:</p>
                    423: 
                    424: <pre>&lt;section&gt;
                    425:  &lt;!-- ... --&gt;
                    426:  &lt;footer&gt;
                    427:   &lt;p&gt;Last modified: 2001-04-23&lt;/p&gt;
                    428:   &lt;address&gt;Author: fred@example.com&lt;/address&gt;
                    429:  &lt;/footer&gt;
                    430: &lt;/section&gt;</pre>
                    431: 
1.204     mike      432:   </div><h4 id="the-hr-element"><span class="secno">4.5.2 </span>The <dfn><code>hr</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike      433:    <dd><a href="content-models.html#flow-content" id="flow-content-42">Flow content</a>.</dd>
                    434:    <dt>Contexts in which this element can be used:</dt>
                    435:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-43">flow content</a> is expected.</dd>
1.12      mike      436:    <dt>Content model:</dt>
                    437:    <dd>Empty.</dd>
                    438:    <dt>Content attributes:</dt>
1.159     mike      439:    <dd><a href="elements.html#global-attributes" id="global-attributes-20">Global attributes</a></dd>
1.12      mike      440:    <dt>DOM interface:</dt>
                    441:    <dd>
1.159     mike      442:     <pre class="idl">interface <dfn id="htmlhrelement">HTMLHRElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-27">HTMLElement</a> {};</pre>
1.12      mike      443:    </dd>
1.165     mike      444:   </dl><p>The <code><a href="#the-hr-element" id="hr-3">hr</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a
1.159     mike      445:   <a href="content-models.html#paragraph" id="paragraph-6">paragraph</a>-level thematic break, e.g. a scene change in
1.12      mike      446:   a story, or a transition to another topic within a section of a
1.163     mike      447:   reference book.<div class="example">
1.12      mike      448: 
1.33      mike      449:    <p>The following fictional extract from a project manual shows two
1.159     mike      450:    sections that use the <code><a href="#the-hr-element" id="hr-4">hr</a></code> element to separate topics
1.33      mike      451:    within the section.</p>
                    452: 
                    453:    <pre>&lt;section&gt;
                    454:  &lt;h1&gt;Communication&lt;/h1&gt;
                    455:  &lt;p&gt;There are various methods of communication. This section
                    456:  covers a few of the important ones used by the project.&lt;/p&gt;
                    457:  <strong>&lt;hr&gt;</strong>
                    458:  &lt;p&gt;Communication stones seem to come in pairs and have mysterious
                    459:  properties:&lt;/p&gt;
                    460:  &lt;ul&gt;
                    461:   &lt;li&gt;They can transfer thoughts in two directions once activated
                    462:   if used alone.&lt;/li&gt;
                    463:   &lt;li&gt;If used with another device, they can transfer one's
                    464:   consciousness to another body.&lt;/li&gt;
                    465:   &lt;li&gt;If both stones are used with another device, the
                    466:   consciousnesses switch bodies.&lt;/li&gt;
                    467:  &lt;/ul&gt;
                    468:  <strong>&lt;hr&gt;</strong>
                    469:  &lt;p&gt;Radios use the electromagnetic spectrum in the meter range and
                    470:  longer.&lt;/p&gt;
                    471:  <strong>&lt;hr&gt;</strong>
                    472:  &lt;p&gt;Signal flares use the electromagnetic spectrum in the
                    473:  nanometer range.&lt;/p&gt;
                    474: &lt;/section&gt;
                    475: &lt;section&gt;
                    476:  &lt;h1&gt;Food&lt;/h1&gt;
                    477:  &lt;p&gt;All food at the project is rationed:&lt;/p&gt;
                    478:  &lt;dl&gt;
                    479:   &lt;dt&gt;Potatoes&lt;/dt&gt;
                    480:   &lt;dd&gt;Two per day&lt;/dd&gt;
                    481:   &lt;dt&gt;Soup&lt;/dt&gt;
                    482:   &lt;dd&gt;One bowl per day&lt;/dd&gt;
                    483:  &lt;/dl&gt;
                    484:  <strong>&lt;hr&gt;</strong>
                    485:  &lt;p&gt;Cooking is done by the chefs on a set rotation.&lt;/p&gt;
                    486: &lt;/section&gt;</pre>
                    487: 
1.159     mike      488:    <p>There is no need for an <code><a href="#the-hr-element" id="hr-5">hr</a></code> element between the
                    489:    sections themselves, since the <code><a href="sections.html#the-section-element" id="section-11">section</a></code> elements and
1.264     mike      490:    the <code><a href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements" id="h1-16">h1</a></code> elements imply thematic changes themselves.</p>
1.33      mike      491: 
                    492:   </div><div class="example">
                    493: 
1.12      mike      494:    <p>The following extract from <cite>Pandora's Star</cite> by Peter
                    495:    F. Hamilton shows two paragraphs that precede a scene change and
                    496:    the paragraph that follows it. The scene change, represented in the
                    497:    printed book by a gap containing a solitary centered star between
                    498:    the second and third paragraphs, is here represented using the
1.159     mike      499:    <code><a href="#the-hr-element" id="hr-6">hr</a></code> element.</p>
1.12      mike      500: 
                    501:    <!-- ISBN 1-4050-0020-1; bottom of page 14 -->
                    502: 
                    503:    <pre lang="en-GB">&lt;p&gt;Dudley was ninety-two, in his second life, and fast approaching
                    504: time for another rejuvenation. Despite his body having the physical
                    505: age of a standard fifty-year-old, the prospect of a long degrading
                    506: campaign within academia was one he regarded with dread. For a
                    507: supposedly advanced civilization, the Intersolar Commonwearth could be
                    508: appallingly backward at times, not to mention cruel.&lt;/p&gt;
                    509: &lt;p&gt;&lt;i&gt;Maybe it won't be that bad&lt;/i&gt;, he told himself. The lie was
                    510: comforting enough to get him through the rest of the night's
                    511: shift.&lt;/p&gt;
                    512: <strong>&lt;hr&gt;</strong>
                    513: &lt;p&gt;The Carlton AllLander drove Dudley home just after dawn. Like the
                    514: astronomer, the vehicle was old and worn, but perfectly capable of
                    515: doing its job. It had a cheap diesel engine, common enough on a
                    516: semi-frontier world like Gralmond, although its drive array was a
                    517: thoroughly modern photoneural processor. With its high suspension and
                    518: deep-tread tyres it could plough along the dirt track to the
                    519: observatory in all weather and seasons, including the metre-deep snow
                    520: of Gralmond's winters.&lt;/p&gt;</pre>
                    521: 
1.159     mike      522:   </div><p class="note">The <code><a href="#the-hr-element" id="hr-7">hr</a></code> element does not affect the
1.204     mike      523:   document's <a href="sections.html#outline" id="outline-5">outline</a>.<h4 id="the-pre-element"><span class="secno">4.5.3 </span>The <dfn><code>pre</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike      524:    <dd><a href="content-models.html#flow-content" id="flow-content-44">Flow content</a>.</dd>
1.159     mike      525:    <dd><a href="dnd.html#formatblock-candidate" id="formatblock-candidate-10"><code title="">formatBlock</code> candidate</a>.</dd>
1.205     mike      526:    <dt>Contexts in which this element can be used:</dt>
                    527:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-45">flow content</a> is expected.</dd>
1.12      mike      528:    <dt>Content model:</dt>
1.365   ! mike      529:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-25">Phrasing content</a>.</dd>
1.12      mike      530:    <dt>Content attributes:</dt>
1.159     mike      531:    <dd><a href="elements.html#global-attributes" id="global-attributes-21">Global attributes</a></dd>
1.12      mike      532:    <dt>DOM interface:</dt>
                    533:    <dd>
1.159     mike      534:     <pre class="idl">interface <dfn id="htmlpreelement">HTMLPreElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-28">HTMLElement</a> {};</pre>
1.12      mike      535:    </dd>
1.264     mike      536:   </dl><p>The <code><a href="#the-pre-element" id="pre-0">pre</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a block of
1.12      mike      537:   preformatted text, in which structure is represented by typographic
1.163     mike      538:   conventions rather than by elements.<p class="note">In <a href="syntax.html#syntax" id="the-html-syntax-3">the HTML syntax</a>, a leading
1.264     mike      539:   newline character immediately following the <code><a href="#the-pre-element" id="pre-1">pre</a></code> element
                    540:   start tag is stripped.<p>Some examples of cases where the <code><a href="#the-pre-element" id="pre-2">pre</a></code> element could
1.163     mike      541:   be used:<ul><li>Including an e-mail, with paragraphs indicated by blank lines,
1.12      mike      542:    lists indicated by lines prefixed with a bullet, and so on.</li>
                    543: 
                    544:    <li>Including fragments of computer code, with structure indicated
                    545:    according to the conventions of that language.</li>
                    546: 
                    547:    <li>Displaying ASCII art.</li>
                    548: 
                    549:   </ul><p class="note">Authors are encouraged to consider how preformatted
                    550:   text will be experienced when the formatting is lost, as will be the
                    551:   case for users of speech synthesizers, braille displays, and the
                    552:   like. For cases like ASCII art, it is likely that an alternative
                    553:   presentation, such as a textual description, would be more
1.264     mike      554:   universally accessible to the readers of the document.<p>To represent a block of computer code, the <code><a href="#the-pre-element" id="pre-3">pre</a></code>
                    555:   element can be used with a <code><a href="text-level-semantics.html#the-code-element" id="code-1">code</a></code> element; to represent a
                    556:   block of computer output the <code><a href="#the-pre-element" id="pre-4">pre</a></code> element can be used
                    557:   with a <code><a href="text-level-semantics.html#the-samp-element" id="samp-1">samp</a></code> element. Similarly, the <code><a href="text-level-semantics.html#the-kbd-element" id="kbd-2">kbd</a></code>
                    558:   element can be used within a <code><a href="#the-pre-element" id="pre-5">pre</a></code> element to indicate
1.324     mike      559:   text that the user is to enter.<p class="note">A newline in a <code><a href="#the-pre-element" id="pre-6">pre</a></code> element separates
                    560:   paragraphs for the purposes of the Unicode bidirectional algorithm.
                    561:   <a href="references.html#refsBIDI">[BIDI]</a><div class="example">
1.12      mike      562: 
                    563:    <p>In the following snippet, a sample of computer code is
                    564:    presented.</p>
                    565: 
                    566:    <pre>&lt;p&gt;This is the &lt;code&gt;Panel&lt;/code&gt; constructor:&lt;/p&gt;
                    567: &lt;pre&gt;&lt;code&gt;function Panel(element, canClose, closeHandler) {
                    568:   this.element = element;
                    569:   this.canClose = canClose;
                    570:   this.closeHandler = function () { if (closeHandler) closeHandler() };
                    571: }&lt;/code&gt;&lt;/pre&gt;</pre>
                    572: 
                    573:   </div><div class="example">
                    574: 
1.264     mike      575:    <p>In the following snippet, <code><a href="text-level-semantics.html#the-samp-element" id="samp-2">samp</a></code> and <code><a href="text-level-semantics.html#the-kbd-element" id="kbd-3">kbd</a></code>
1.324     mike      576:    elements are mixed in the contents of a <code><a href="#the-pre-element" id="pre-7">pre</a></code> element to
1.12      mike      577:    show a session of Zork I.</p>
                    578: 
                    579:    <pre>&lt;pre&gt;&lt;samp&gt;You are in an open field west of a big white house with a boarded
                    580: front door.
                    581: There is a small mailbox here.
                    582: 
                    583: &gt;&lt;/samp&gt; &lt;kbd&gt;open mailbox&lt;/kbd&gt;
                    584: 
                    585: &lt;samp&gt;Opening the mailbox reveals:
                    586: A leaflet.
                    587: 
                    588: &gt;&lt;/samp&gt;&lt;/pre&gt;</pre>
                    589: 
                    590:   </div><div class="example">
                    591: 
                    592:    <p>The following shows a contemporary poem that uses the
1.324     mike      593:    <code><a href="#the-pre-element" id="pre-8">pre</a></code> element to preserve its unusual formatting, which
1.12      mike      594:    forms an intrinsic part of the poem itself.</p>
                    595: 
                    596:    <pre>&lt;pre&gt;                maxling
                    597: 
                    598: it is with a          heart
                    599:                heavy
                    600: 
                    601: that i admit loss of a feline
                    602:         so           loved
                    603: 
                    604: a friend lost to the
                    605:         unknown
                    606:                                 (night)
                    607: 
                    608: ~cdr 11dec07&lt;/pre&gt;</pre>
                    609: 
1.204     mike      610:   </div><h4 id="the-blockquote-element"><span class="secno">4.5.4 </span>The <dfn><code>blockquote</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike      611:    <dd><a href="content-models.html#flow-content" id="flow-content-46">Flow content</a>.</dd>
1.159     mike      612:    <dd><a href="sections.html#sectioning-root" id="sectioning-root-6">Sectioning root</a>.</dd>
                    613:    <dd><a href="dnd.html#formatblock-candidate" id="formatblock-candidate-11"><code title="">formatBlock</code> candidate</a>.</dd>
1.205     mike      614:    <dt>Contexts in which this element can be used:</dt>
                    615:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-47">flow content</a> is expected.</dd>
1.12      mike      616:    <dt>Content model:</dt>
1.205     mike      617:    <dd><a href="content-models.html#flow-content" id="flow-content-48">Flow content</a>.</dd>
1.12      mike      618:    <dt>Content attributes:</dt>
1.159     mike      619:    <dd><a href="elements.html#global-attributes" id="global-attributes-22">Global attributes</a></dd>
                    620:    <dd><code title="attr-blockquote-cite"><a href="#attr-blockquote-cite" id="cite">cite</a></code></dd>
1.12      mike      621:    <dt>DOM interface:</dt>
                    622:    <dd>
1.159     mike      623: <pre class="idl">interface <dfn id="htmlquoteelement">HTMLQuoteElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-29">HTMLElement</a> {
1.165     mike      624:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/grouping-content.html#dom-quote-cite" title='Read about this "cite" reference in the full HTML5 spec.'>cite</a>;
1.12      mike      625: };</pre>
1.159     mike      626:     <p class="note">The <code><a href="#htmlquoteelement" id="htmlquoteelement-0">HTMLQuoteElement</a></code> interface is
1.264     mike      627:     also used by the <code><a href="text-level-semantics.html#the-q-element" id="q-2">q</a></code> element.</p>
1.12      mike      628:    </dd>
1.264     mike      629:   </dl><p>The <code><a href="#the-blockquote-element" id="blockquote-2">blockquote</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a
                    630:   section that is quoted from another source.<p>Content inside a <code><a href="#the-blockquote-element" id="blockquote-3">blockquote</a></code> must be quoted from
1.35      mike      631:   another source, whose address, if it has one, may be cited in the
1.12      mike      632:   <dfn id="attr-blockquote-cite" title="attr-blockquote-cite"><code>cite</code></dfn>
1.163     mike      633:   attribute.<p>If the <code title="attr-blockquote-cite"><a href="#attr-blockquote-cite" id="cite-0">cite</a></code> attribute
1.159     mike      634:   is present, it must be a <a href="urls.html#valid-url-potentially-surrounded-by-spaces" id="valid-url-potentially-surrounded-by-spaces-1">valid URL potentially surrounded by
1.163     mike      635:   spaces</a>. <div class="example">
1.12      mike      636: 
1.264     mike      637:    <p>This next example shows the use of <code><a href="text-level-semantics.html#the-cite-element" id="cite-5">cite</a></code> alongside
                    638:    <code><a href="#the-blockquote-element" id="blockquote-4">blockquote</a></code>:</p>
1.12      mike      639: 
                    640:    <pre>&lt;p&gt;His next piece was the aptly named &lt;cite&gt;Sonnet 130&lt;/cite&gt;:&lt;/p&gt;
                    641: &lt;blockquote cite="http://quotes.example.org/s/sonnet130.html"&gt;
                    642:   &lt;p&gt;My mistress' eyes are nothing like the sun,&lt;br&gt;
                    643:   Coral is far more red, than her lips red,&lt;br&gt;
                    644:   ...</pre>
                    645: 
                    646:   </div><div class="example">
                    647: 
                    648:    <p>This example shows how a forum post could use
1.264     mike      649:    <code><a href="#the-blockquote-element" id="blockquote-5">blockquote</a></code> to show what post a user is replying
1.159     mike      650:    to. The <code><a href="sections.html#the-article-element" id="article-14">article</a></code> element is used for each post, to mark
1.12      mike      651:    up the threading.</p>
                    652: 
                    653:    <pre>&lt;article&gt;
                    654:  &lt;h1&gt;&lt;a href="http://bacon.example.com/?blog=109431"&gt;Bacon on a crowbar&lt;/a&gt;&lt;/h1&gt;
                    655:  &lt;article&gt;
                    656:   &lt;header&gt;&lt;strong&gt;t3yw&lt;/strong&gt; 12 points 1 hour ago&lt;/header&gt;
                    657:   &lt;p&gt;I bet a narwhal would love that.&lt;/p&gt;
                    658:   &lt;footer&gt;&lt;a href="?pid=29578"&gt;permalink&lt;/a&gt;&lt;/footer&gt;
                    659:   &lt;article&gt;
                    660:    &lt;header&gt;&lt;strong&gt;greg&lt;/strong&gt; 8 points 1 hour ago&lt;/header&gt;
                    661:    &lt;blockquote&gt;&lt;p&gt;I bet a narwhal would love that.&lt;/p&gt;&lt;/blockquote&gt;
                    662:    &lt;p&gt;Dude narwhals don't eat bacon.&lt;/p&gt;
                    663:    &lt;footer&gt;&lt;a href="?pid=29579"&gt;permalink&lt;/a&gt;&lt;/footer&gt;
                    664:    &lt;article&gt;
                    665:     &lt;header&gt;&lt;strong&gt;t3yw&lt;/strong&gt; 15 points 1 hour ago&lt;/header&gt;
                    666:     &lt;blockquote&gt;
                    667:      &lt;blockquote&gt;&lt;p&gt;I bet a narwhal would love that.&lt;/p&gt;&lt;/blockquote&gt;
                    668:      &lt;p&gt;Dude narwhals don't eat bacon.&lt;/p&gt;
                    669:     &lt;/blockquote&gt;
                    670:     &lt;p&gt;Next thing you'll be saying they don't get capes and wizard
                    671:     hats either!&lt;/p&gt;
                    672:     &lt;footer&gt;&lt;a href="?pid=29580"&gt;permalink&lt;/a&gt;&lt;/footer&gt;
                    673:     &lt;article&gt;
                    674:      &lt;article&gt;
                    675:       &lt;header&gt;&lt;strong&gt;boing&lt;/strong&gt; -5 points 1 hour ago&lt;/header&gt;
                    676:       &lt;p&gt;narwhals are worse than ceiling cat&lt;/p&gt;
                    677:       &lt;footer&gt;&lt;a href="?pid=29581"&gt;permalink&lt;/a&gt;&lt;/footer&gt;
                    678:      &lt;/article&gt;
                    679:     &lt;/article&gt;
                    680:    &lt;/article&gt;
                    681:   &lt;/article&gt;
                    682:   &lt;article&gt;
                    683:    &lt;header&gt;&lt;strong&gt;fred&lt;/strong&gt; 1 points 23 minutes ago&lt;/header&gt;
                    684:    &lt;blockquote&gt;&lt;p&gt;I bet a narwhal would love that.&lt;/p&gt;&lt;/blockquote&gt;
                    685:    &lt;p&gt;I bet they'd love to peel a banana too.&lt;/p&gt;
                    686:    &lt;footer&gt;&lt;a href="?pid=29582"&gt;permalink&lt;/a&gt;&lt;/footer&gt;
                    687:   &lt;/article&gt;
                    688:  &lt;/article&gt;
                    689: &lt;/article&gt;</pre>
                    690: 
1.16      mike      691:   </div><p class="note"><a href="links.html#conversations">Examples of how to
1.12      mike      692:   represent a conversation</a> are shown in a later section; it is not
1.264     mike      693:   appropriate to use the <code><a href="text-level-semantics.html#the-cite-element" id="cite-6">cite</a></code> and <code><a href="#the-blockquote-element" id="blockquote-6">blockquote</a></code>
1.204     mike      694:   elements for this purpose.<h4 id="the-ol-element"><span class="secno">4.5.5 </span>The <dfn><code>ol</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike      695:    <dd><a href="content-models.html#flow-content" id="flow-content-49">Flow content</a>.</dd>
                    696:    <dt>Contexts in which this element can be used:</dt>
                    697:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-50">flow content</a> is expected.</dd>
1.12      mike      698:    <dt>Content model:</dt>
1.264     mike      699:    <dd>Zero or more <code><a href="#the-li-element" id="li-2">li</a></code> elements.</dd>
1.12      mike      700:    <dt>Content attributes:</dt>
1.159     mike      701:    <dd><a href="elements.html#global-attributes" id="global-attributes-23">Global attributes</a></dd>
                    702:    <dd><code title="attr-ol-reversed"><a href="#attr-ol-reversed" id="reversed">reversed</a></code></dd>
                    703:    <dd><code title="attr-ol-start"><a href="#attr-ol-start" id="start">start</a></code></dd>
1.215     mike      704:    <dd><code title="attr-ol-type"><a href="#attr-ol-type" id="type-16">type</a></code></dd>
1.12      mike      705:    <dt>DOM interface:</dt>
                    706:    <dd>
1.159     mike      707: <pre class="idl">interface <dfn id="htmlolistelement">HTMLOListElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-30">HTMLElement</a> {
1.165     mike      708:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/grouping-content.html#dom-ol-reversed" title='Read about this "reversed" reference in the full HTML5 spec.'>reversed</a>;
                    709:            attribute long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/grouping-content.html#dom-ol-start" title='Read about this "start" reference in the full HTML5 spec.'>start</a>;
1.215     mike      710:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/obsolete.html#dom-ol-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a>;
1.12      mike      711: };</pre>
                    712:    </dd>
1.165     mike      713:   </dl><p>The <code><a href="#the-ol-element" id="ol-4">ol</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a list of
1.12      mike      714:   items, where the items have been intentionally ordered, such that
1.264     mike      715:   changing the order would change the meaning of the document.<p>The items of the list are the <code><a href="#the-li-element" id="li-3">li</a></code> element child nodes
1.324     mike      716:   of the <code><a href="#the-ol-element" id="ol-5">ol</a></code> element, in <a href="infrastructure.html#tree-order" id="tree-order-5">tree order</a>.<p>The <dfn id="attr-ol-reversed" title="attr-ol-reversed"><code>reversed</code></dfn>
1.159     mike      717:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-2">boolean attribute</a>. If present, it
1.12      mike      718:   indicates that the list is a descending list (..., 3, 2, 1). If the
                    719:   attribute is omitted, the list is an ascending list (1, 2, 3,
1.163     mike      720:   ...).<p>The <dfn id="attr-ol-start" title="attr-ol-start"><code>start</code></dfn>
1.159     mike      721:   attribute, if present, must be a <a href="common-microsyntaxes.html#valid-integer" id="valid-integer-3">valid integer</a> giving
1.215     mike      722:   the <a href="#ordinal-value" id="ordinal-value-0">ordinal value</a> of the first list item.<p>The <dfn id="attr-ol-type" title="attr-ol-type"><code>type</code></dfn> attribute
                    723:   can be used to specify the kind of marker to use in the list, in the
                    724:   cases where that matters (e.g. because items are to be referened by
                    725:   their number/letter). The attribute, if specified, must have a value
                    726:   that is a <a href="infrastructure.html#case-sensitive" id="case-sensitive-2">case-sensitive</a> match for one of the
                    727:   characters given in the first cell of one of the rows of the
                    728:   following table. <table><thead><tr><th>Keyword
                    729:      <th>State
                    730:      <th>Description
                    731:      <th colspan="8">Examples for values 1-3 and 3999-4001
                    732:    <tbody><tr><td><dfn id="attr-ol-type-keyword-decimal" title="attr-ol-type-keyword-decimal"><code>1</code></dfn> (U+0031)
                    733:      <td><dfn id="attr-ol-type-state-decimal" title="attr-ol-type-state-decimal">decimal</dfn>
                    734:      <td>Decimal numbers
                    735:      <td class="eg"><samp>1.</samp> <td class="eg"><samp>2.</samp> <td class="eg"><samp>3.</samp> <td class="eg">... <td class="eg"><samp>3999.</samp> <td class="eg"><samp>4000.</samp> <td class="eg"><samp>4001.</samp> <td class="eg">...
                    736:     <tr><td><dfn id="attr-ol-type-keyword-lower-alpha" title="attr-ol-type-keyword-lower-alpha"><code>a</code></dfn> (U+0061)
                    737:      <td><dfn id="attr-ol-type-state-lower-alpha" title="attr-ol-type-state-lower-alpha">lower-alpha</dfn>
                    738:      <td>Lowercase latin alphabet
                    739:      <td class="eg"><samp>a.</samp> <td class="eg"><samp>b.</samp> <td class="eg"><samp>c.</samp> <td class="eg">... <td class="eg"><samp>ewu.</samp> <td class="eg"><samp>ewv.</samp> <td class="eg"><samp>eww.</samp> <td class="eg">...
                    740:     <tr><td><dfn id="attr-ol-type-keyword-upper-alpha" title="attr-ol-type-keyword-upper-alpha"><code>A</code></dfn> (U+0041)
                    741:      <td><dfn id="attr-ol-type-state-upper-alpha" title="attr-ol-type-state-upper-alpha">upper-alpha</dfn>
                    742:      <td>Uppercase latin alphabet
                    743:      <td class="eg"><samp>A.</samp> <td class="eg"><samp>B.</samp> <td class="eg"><samp>C.</samp> <td class="eg">... <td class="eg"><samp>EWU.</samp> <td class="eg"><samp>EWV.</samp> <td class="eg"><samp>EWW.</samp> <td class="eg">...
                    744:     <tr><td><dfn id="attr-ol-type-keyword-lower-roman" title="attr-ol-type-keyword-lower-roman"><code>i</code></dfn> (U+0069)
                    745:      <td><dfn id="attr-ol-type-state-lower-roman" title="attr-ol-type-state-lower-roman">lower-roman</dfn>
                    746:      <td>Lowercase roman numerals
1.322     mike      747:      <td class="eg"><samp>i.</samp> <td class="eg"><samp>ii.</samp> <td class="eg"><samp>iii.</samp> <td class="eg">... <td class="eg"><samp>mmmcmxcix.</samp> <td class="eg"><samp>i&#773;v&#773;.</samp> <td class="eg"><samp>i&#773;v&#773;i.</samp> <td class="eg">...
1.215     mike      748:     <tr><td><dfn id="attr-ol-type-keyword-upper-roman" title="attr-ol-type-keyword-upper-roman"><code>I</code></dfn> (U+0049)
                    749:      <td><dfn id="attr-ol-type-state-upper-roman" title="attr-ol-type-state-upper-roman">upper-roman</dfn>
                    750:      <td>Uppercase roman numerals
1.322     mike      751:      <td class="eg"><samp>I.</samp> <td class="eg"><samp>II.</samp> <td class="eg"><samp>III.</samp> <td class="eg">... <td class="eg"><samp>MMMCMXCIX.</samp> <td class="eg"><samp>I&#773;V&#773;.</samp> <td class="eg"><samp>I&#773;V&#773;I.</samp> <td class="eg">...
1.215     mike      752:   </table><!-- v2: resuming numbering of lists from previous lists? --><div class="example">
1.12      mike      753: 
                    754:    <p>The following markup shows a list where the order matters, and
1.159     mike      755:    where the <code><a href="#the-ol-element" id="ol-6">ol</a></code> element is therefore appropriate. Compare
                    756:    this list to the equivalent list in the <code><a href="#the-ul-element" id="ul-4">ul</a></code> section to
                    757:    see an example of the same items using the <code><a href="#the-ul-element" id="ul-5">ul</a></code>
1.12      mike      758:    element.</p>
                    759: 
                    760:    <pre>&lt;p&gt;I have lived in the following countries (given in the order of when
                    761: I first lived there):&lt;/p&gt;
                    762: &lt;ol&gt;
                    763:  &lt;li&gt;Switzerland
                    764:  &lt;li&gt;United Kingdom
                    765:  &lt;li&gt;United States
                    766:  &lt;li&gt;Norway
                    767: &lt;/ol&gt;</pre>
                    768: 
                    769:    <p>Note how changing the order of the list changes the meaning of
                    770:    the document. In the following example, changing the relative order
                    771:    of the first two items has changed the birthplace of the
                    772:    author:</p>
                    773: 
                    774:    <pre>&lt;p&gt;I have lived in the following countries (given in the order of when
                    775: I first lived there):&lt;/p&gt;
                    776: &lt;ol&gt;
                    777:  &lt;li&gt;United Kingdom
                    778:  &lt;li&gt;Switzerland
                    779:  &lt;li&gt;United States
                    780:  &lt;li&gt;Norway
                    781: &lt;/ol&gt;</pre>
                    782: 
1.204     mike      783:   </div><h4 id="the-ul-element"><span class="secno">4.5.6 </span>The <dfn><code>ul</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike      784:    <dd><a href="content-models.html#flow-content" id="flow-content-51">Flow content</a>.</dd>
                    785:    <dt>Contexts in which this element can be used:</dt>
                    786:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-52">flow content</a> is expected.</dd>
1.12      mike      787:    <dt>Content model:</dt>
1.264     mike      788:    <dd>Zero or more <code><a href="#the-li-element" id="li-4">li</a></code> elements.</dd>
1.12      mike      789:    <dt>Content attributes:</dt>
1.159     mike      790:    <dd><a href="elements.html#global-attributes" id="global-attributes-24">Global attributes</a></dd>
1.12      mike      791:    <dt>DOM interface:</dt>
                    792:    <dd>
1.159     mike      793:     <pre class="idl">interface <dfn id="htmlulistelement">HTMLUListElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-31">HTMLElement</a> {};</pre>
1.12      mike      794:    </dd>
1.165     mike      795:   </dl><p>The <code><a href="#the-ul-element" id="ul-6">ul</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a list of
1.163     mike      796:   items, where the order of the items is not important &mdash; that
1.12      mike      797:   is, where changing the order would not materially change the meaning
1.264     mike      798:   of the document.<p>The items of the list are the <code><a href="#the-li-element" id="li-5">li</a></code> element child nodes
1.163     mike      799:   of the <code><a href="#the-ul-element" id="ul-7">ul</a></code> element.<div class="example">
1.12      mike      800: 
                    801:    <p>The following markup shows a list where the order does not
1.159     mike      802:    matter, and where the <code><a href="#the-ul-element" id="ul-8">ul</a></code> element is therefore
1.12      mike      803:    appropriate. Compare this list to the equivalent list in the
1.159     mike      804:    <code><a href="#the-ol-element" id="ol-7">ol</a></code> section to see an example of the same items using
                    805:    the <code><a href="#the-ol-element" id="ol-8">ol</a></code> element.</p>
1.12      mike      806: 
                    807:    <pre>&lt;p&gt;I have lived in the following countries:&lt;/p&gt;
                    808: &lt;ul&gt;
                    809:  &lt;li&gt;Norway
                    810:  &lt;li&gt;Switzerland
                    811:  &lt;li&gt;United Kingdom
                    812:  &lt;li&gt;United States
                    813: &lt;/ul&gt;</pre>
                    814: 
                    815:    <p>Note that changing the order of the list does not change the
                    816:    meaning of the document. The items in the snippet above are given
                    817:    in alphabetical order, but in the snippet below they are given in
                    818:    order of the size of their current account balance in 2007, without
                    819:    changing the meaning of the document whatsoever:</p>
                    820: 
                    821:    <pre>&lt;p&gt;I have lived in the following countries:&lt;/p&gt;
                    822: &lt;ul&gt;
                    823:  &lt;li&gt;Switzerland
                    824:  &lt;li&gt;Norway
                    825:  &lt;li&gt;United Kingdom
                    826:  &lt;li&gt;United States
                    827: &lt;/ul&gt;</pre>
                    828: 
1.204     mike      829:   </div><h4 id="the-li-element"><span class="secno">4.5.7 </span>The <dfn><code>li</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.12      mike      830:    <dd>None.</dd>
1.205     mike      831:    <dt>Contexts in which this element can be used:</dt>
1.159     mike      832:    <dd>Inside <code><a href="#the-ol-element" id="ol-9">ol</a></code> elements.</dd>
                    833:    <dd>Inside <code><a href="#the-ul-element" id="ul-9">ul</a></code> elements.</dd>
1.264     mike      834:    <dd>Inside <code><a href="interactive-elements.html#menus" id="menu-8">menu</a></code> elements.</dd>
1.12      mike      835:    <dt>Content model:</dt>
1.205     mike      836:    <dd><a href="content-models.html#flow-content" id="flow-content-53">Flow content</a>.</dd>
1.12      mike      837:    <dt>Content attributes:</dt>
1.159     mike      838:    <dd><a href="elements.html#global-attributes" id="global-attributes-25">Global attributes</a></dd>
                    839:    <dd>If the element is a child of an <code><a href="#the-ol-element" id="ol-10">ol</a></code> element: <code title="attr-li-value"><a href="#attr-li-value" id="value">value</a></code></dd>
1.12      mike      840:    <dt>DOM interface:</dt>
                    841:    <dd>
1.159     mike      842: <pre class="idl">interface <dfn id="htmllielement">HTMLLIElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-32">HTMLElement</a> {
1.165     mike      843:            attribute long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/grouping-content.html#dom-li-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
1.12      mike      844: };</pre>
                    845:    </dd>
1.264     mike      846:   </dl><p>The <code><a href="#the-li-element" id="li-6">li</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a list
1.159     mike      847:   item. If its parent element is an <code><a href="#the-ol-element" id="ol-11">ol</a></code>, <code><a href="#the-ul-element" id="ul-10">ul</a></code>,
1.264     mike      848:   or <code><a href="interactive-elements.html#menus" id="menu-9">menu</a></code> element, then the element is an item of the
1.12      mike      849:   parent element's list, as defined for those elements. Otherwise, the
                    850:   list item has no defined list-related relationship to any other
1.264     mike      851:   <code><a href="#the-li-element" id="li-7">li</a></code> element.<p>If the parent element is an <code><a href="#the-ol-element" id="ol-12">ol</a></code> element, then the
                    852:   <code><a href="#the-li-element" id="li-8">li</a></code> element has an <dfn id="ordinal-value">ordinal value</dfn>.<p>The <dfn id="attr-li-value" title="attr-li-value"><code>value</code></dfn>
1.159     mike      853:   attribute, if present, must be a <a href="common-microsyntaxes.html#valid-integer" id="valid-integer-4">valid integer</a> giving
1.184     mike      854:   the <a href="#ordinal-value" id="ordinal-value-1">ordinal value</a> of the list item.<div class="example">
1.12      mike      855:    <p>The following example, the top ten movies are listed (in reverse
                    856:    order). Note the way the list is given a title by using a
1.264     mike      857:    <code><a href="#the-figure-element" id="figure-1">figure</a></code> element and its <code><a href="#the-figcaption-element" id="figcaption">figcaption</a></code>
1.14      mike      858:    element.</p>
1.12      mike      859:    <pre>&lt;figure&gt;
1.14      mike      860:  &lt;figcaption&gt;The top 10 movies of all time&lt;/figcaption&gt;
                    861:  &lt;ol&gt;
                    862:   &lt;li value="10"&gt;&lt;cite&gt;Josie and the Pussycats&lt;/cite&gt;, 2001&lt;/li&gt;
1.322     mike      863:   &lt;li value="9"&gt;&lt;cite lang="sh"&gt;&#1062;&#1088;&#1085;&#1072; &#1084;&#1072;&#1095;&#1082;&#1072;, &#1073;&#1077;&#1083;&#1080; &#1084;&#1072;&#1095;&#1086;&#1088;&lt;/cite&gt;, 1998&lt;/li&gt;
1.14      mike      864:   &lt;li value="8"&gt;&lt;cite&gt;A Bug's Life&lt;/cite&gt;, 1998&lt;/li&gt;
                    865:   &lt;li value="7"&gt;&lt;cite&gt;Toy Story&lt;/cite&gt;, 1995&lt;/li&gt;
                    866:   &lt;li value="6"&gt;&lt;cite&gt;Monsters, Inc&lt;/cite&gt;, 2001&lt;/li&gt;
                    867:   &lt;li value="5"&gt;&lt;cite&gt;Cars&lt;/cite&gt;, 2006&lt;/li&gt;
                    868:   &lt;li value="4"&gt;&lt;cite&gt;Toy Story 2&lt;/cite&gt;, 1999&lt;/li&gt;
                    869:   &lt;li value="3"&gt;&lt;cite&gt;Finding Nemo&lt;/cite&gt;, 2003&lt;/li&gt;
                    870:   &lt;li value="2"&gt;&lt;cite&gt;The Incredibles&lt;/cite&gt;, 2004&lt;/li&gt;
                    871:   &lt;li value="1"&gt;&lt;cite&gt;Ratatouille&lt;/cite&gt;, 2007&lt;/li&gt;
                    872:  &lt;/ol&gt;
1.12      mike      873: &lt;/figure&gt;</pre>
                    874: 
1.159     mike      875:    <p>The markup could also be written as follows, using the <code title="attr-ol-reversed"><a href="#attr-ol-reversed" id="reversed-0">reversed</a></code> attribute on the
1.184     mike      876:    <code><a href="#the-ol-element" id="ol-13">ol</a></code> element:</p>
1.12      mike      877: 
                    878:    <pre>&lt;figure&gt;
1.14      mike      879:  &lt;figcaption&gt;The top 10 movies of all time&lt;/figcaption&gt;
                    880:  &lt;ol reversed&gt;
                    881:   &lt;li&gt;&lt;cite&gt;Josie and the Pussycats&lt;/cite&gt;, 2001&lt;/li&gt;
1.322     mike      882:   &lt;li&gt;&lt;cite lang="sh"&gt;&#1062;&#1088;&#1085;&#1072; &#1084;&#1072;&#1095;&#1082;&#1072;, &#1073;&#1077;&#1083;&#1080; &#1084;&#1072;&#1095;&#1086;&#1088;&lt;/cite&gt;, 1998&lt;/li&gt;
1.14      mike      883:   &lt;li&gt;&lt;cite&gt;A Bug's Life&lt;/cite&gt;, 1998&lt;/li&gt;
                    884:   &lt;li&gt;&lt;cite&gt;Toy Story&lt;/cite&gt;, 1995&lt;/li&gt;
                    885:   &lt;li&gt;&lt;cite&gt;Monsters, Inc&lt;/cite&gt;, 2001&lt;/li&gt;
                    886:   &lt;li&gt;&lt;cite&gt;Cars&lt;/cite&gt;, 2006&lt;/li&gt;
                    887:   &lt;li&gt;&lt;cite&gt;Toy Story 2&lt;/cite&gt;, 1999&lt;/li&gt;
                    888:   &lt;li&gt;&lt;cite&gt;Finding Nemo&lt;/cite&gt;, 2003&lt;/li&gt;
                    889:   &lt;li&gt;&lt;cite&gt;The Incredibles&lt;/cite&gt;, 2004&lt;/li&gt;
                    890:   &lt;li&gt;&lt;cite&gt;Ratatouille&lt;/cite&gt;, 2007&lt;/li&gt;
                    891:  &lt;/ol&gt;
1.12      mike      892: &lt;/figure&gt;</pre>
1.264     mike      893:   </div><p class="note">If the <code><a href="#the-li-element" id="li-9">li</a></code> element is the child of a
                    894:   <code><a href="interactive-elements.html#menus" id="menu-10">menu</a></code> element and itself has a child that defines a
1.159     mike      895:   <a href="commands.html#concept-command" id="concept-command-3" title="concept-command">command</a>, then the
1.264     mike      896:   <code><a href="#the-li-element" id="li-10">li</a></code> element will match the <code title="selector-enabled"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/links.html#selector-enabled" title='Read about this ":enabled" reference in the full HTML5 spec.'>:enabled</a></code> and <code title="selector-disabled"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/links.html#selector-disabled" title='Read about this ":disabled" reference in the full HTML5 spec.'>:disabled</a></code> pseudo-classes in the
1.204     mike      897:   same way as the first such child element does.<h4 id="the-dl-element"><span class="secno">4.5.8 </span>The <dfn><code>dl</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike      898:    <dd><a href="content-models.html#flow-content" id="flow-content-54">Flow content</a>.</dd>
                    899:    <dt>Contexts in which this element can be used:</dt>
                    900:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-55">flow content</a> is expected.</dd>
1.12      mike      901:    <dt>Content model:</dt>
                    902:    <dd>Zero or more groups each consisting of one or more
1.264     mike      903:    <code><a href="#the-dt-element" id="dt">dt</a></code> elements followed by one or more <code><a href="#the-dd-element" id="dd">dd</a></code>
1.12      mike      904:    elements.</dd>
                    905:    <dt>Content attributes:</dt>
1.159     mike      906:    <dd><a href="elements.html#global-attributes" id="global-attributes-26">Global attributes</a></dd>
1.12      mike      907:    <dt>DOM interface:</dt>
                    908:    <dd>
1.159     mike      909:     <pre class="idl">interface <dfn id="htmldlistelement">HTMLDListElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-33">HTMLElement</a> {};</pre>
1.12      mike      910:    </dd>
1.264     mike      911:   </dl><p>The <code><a href="#the-dl-element" id="dl-0">dl</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> an
1.12      mike      912:   association list consisting of zero or more name-value groups (a
                    913:   description list). Each group must consist of one or more names
1.264     mike      914:   (<code><a href="#the-dt-element" id="dt-0">dt</a></code> elements) followed by one or more values
                    915:   (<code><a href="#the-dd-element" id="dd-0">dd</a></code> elements). Within a single <code><a href="#the-dl-element" id="dl-1">dl</a></code> element,
                    916:   there should not be more than one <code><a href="#the-dt-element" id="dt-1">dt</a></code> element for each
1.163     mike      917:   name.<p>Name-value groups may be terms and definitions, metadata topics
1.205     mike      918:   and values, questions and answers, or any other groups of name-value
                    919:   data.<p>The values within a group are alternatives; multiple paragraphs
1.12      mike      920:   forming part of the same value must all be given within the same
1.264     mike      921:   <code><a href="#the-dd-element" id="dd-1">dd</a></code> element.<p>The order of the list of groups, and of the names and values
1.163     mike      922:   within each group, may be significant.<div class="example">
1.12      mike      923:    <p>In the following example, one entry ("Authors") is linked to two
                    924:    values ("John" and "Luke").</p>
                    925:    <pre>&lt;dl&gt;
                    926:  &lt;dt&gt; Authors
                    927:  &lt;dd&gt; John
                    928:  &lt;dd&gt; Luke
                    929:  &lt;dt&gt; Editor
                    930:  &lt;dd&gt; Frank
                    931: &lt;/dl&gt;</pre>
                    932:   </div><div class="example">
                    933:    <p>In the following example, one definition is linked to two
                    934:    terms.</p>
                    935:    <pre>&lt;dl&gt;
                    936:  &lt;dt lang="en-US"&gt; &lt;dfn&gt;color&lt;/dfn&gt; &lt;/dt&gt;
                    937:  &lt;dt lang="en-GB"&gt; &lt;dfn&gt;colour&lt;/dfn&gt; &lt;/dt&gt;
                    938:  &lt;dd&gt; A sensation which (in humans) derives from the ability of
                    939:  the fine structure of the eye to distinguish three differently
                    940:  filtered analyses of a view. &lt;/dd&gt;
                    941: &lt;/dl&gt;</pre>
                    942:   </div><div class="example">
1.264     mike      943:    <p>The following example illustrates the use of the <code><a href="#the-dl-element" id="dl-2">dl</a></code>
1.12      mike      944:    element to mark up metadata of sorts. At the end of the example,
                    945:    one group has two metadata labels ("Authors" and "Editors") and two
                    946:    values ("Robert Rothman" and "Daniel Jackson").</p>
                    947:    <pre>&lt;dl&gt;
                    948:  &lt;dt&gt; Last modified time &lt;/dt&gt;
                    949:  &lt;dd&gt; 2004-12-23T23:33Z &lt;/dd&gt;
                    950:  &lt;dt&gt; Recommended update interval &lt;/dt&gt;
                    951:  &lt;dd&gt; 60s &lt;/dd&gt;
                    952:  &lt;dt&gt; Authors &lt;/dt&gt;
                    953:  &lt;dt&gt; Editors &lt;/dt&gt;
                    954:  &lt;dd&gt; Robert Rothman &lt;/dd&gt;
                    955:  &lt;dd&gt; Daniel Jackson &lt;/dd&gt;
                    956: &lt;/dl&gt;</pre>
                    957:   </div><div class="example">
                    958: 
1.264     mike      959:    <p>The following example shows the <code><a href="#the-dl-element" id="dl-3">dl</a></code> element used to
1.12      mike      960:    give a set of instructions. The order of the instructions here is
                    961:    important (in the other examples, the order of the blocks was not
                    962:    important).</p>
                    963: 
                    964:    <pre>&lt;p&gt;Determine the victory points as follows (use the
                    965: first matching case):&lt;/p&gt;
                    966: &lt;dl&gt;
                    967:  &lt;dt&gt; If you have exactly five gold coins &lt;/dt&gt;
                    968:  &lt;dd&gt; You get five victory points &lt;/dd&gt;
                    969:  &lt;dt&gt; If you have one or more gold coins, and you have one or more silver coins &lt;/dt&gt;
                    970:  &lt;dd&gt; You get two victory points &lt;/dd&gt;
                    971:  &lt;dt&gt; If you have one or more silver coins &lt;/dt&gt;
                    972:  &lt;dd&gt; You get one victory point &lt;/dd&gt;
                    973:  &lt;dt&gt; Otherwise &lt;/dt&gt;
                    974:  &lt;dd&gt; You get no victory points &lt;/dd&gt;
                    975: &lt;/dl&gt;</pre>
                    976:   </div><div class="example">
1.264     mike      977:    <p>The following snippet shows a <code><a href="#the-dl-element" id="dl-4">dl</a></code> element being used
                    978:    as a glossary. Note the use of <code><a href="text-level-semantics.html#the-dfn-element" id="dfn-1">dfn</a></code> to indicate the
1.12      mike      979:    word being defined.</p>
                    980:    <pre>&lt;dl&gt;
                    981:  &lt;dt&gt;&lt;dfn&gt;Apartment&lt;/dfn&gt;, n.&lt;/dt&gt;
                    982:  &lt;dd&gt;An execution context grouping one or more threads with one or
                    983:  more COM objects.&lt;/dd&gt;
                    984:  &lt;dt&gt;&lt;dfn&gt;Flat&lt;/dfn&gt;, n.&lt;/dt&gt;
                    985:  &lt;dd&gt;A deflated tire.&lt;/dd&gt;
                    986:  &lt;dt&gt;&lt;dfn&gt;Home&lt;/dfn&gt;, n.&lt;/dt&gt;
                    987:  &lt;dd&gt;The user's login directory.&lt;/dd&gt;
                    988: &lt;/dl&gt;</pre>
1.264     mike      989:   </div><p class="note">The <code><a href="#the-dl-element" id="dl-5">dl</a></code> element is inappropriate for
1.16      mike      990:   marking up dialogue. <a href="links.html#conversations">Examples of how to
1.204     mike      991:   mark up dialogue</a> are shown below.<h4 id="the-dt-element"><span class="secno">4.5.9 </span>The <dfn><code>dt</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.12      mike      992:    <dd>None.</dd>
1.205     mike      993:    <dt>Contexts in which this element can be used:</dt>
1.264     mike      994:    <dd>Before <code><a href="#the-dd-element" id="dd-2">dd</a></code> or <code><a href="#the-dt-element" id="dt-2">dt</a></code> elements inside <code><a href="#the-dl-element" id="dl-6">dl</a></code> elements.</dd>
1.12      mike      995:    <dt>Content model:</dt>
1.365   ! mike      996:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-26">Phrasing content</a>.</dd>
1.12      mike      997:    <dt>Content attributes:</dt>
1.159     mike      998:    <dd><a href="elements.html#global-attributes" id="global-attributes-27">Global attributes</a></dd>
1.12      mike      999:    <dt>DOM interface:</dt>
1.159     mike     1000:    <dd>Uses <code><a href="elements.html#htmlelement" id="htmlelement-34">HTMLElement</a></code>.</dd>
1.264     mike     1001:   </dl><p>The <code><a href="#the-dt-element" id="dt-3">dt</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> the term, or
1.14      mike     1002:   name, part of a term-description group in a description list
1.264     mike     1003:   (<code><a href="#the-dl-element" id="dl-7">dl</a></code> element).<p class="note">The <code><a href="#the-dt-element" id="dt-4">dt</a></code> element itself, when used in a
                   1004:   <code><a href="#the-dl-element" id="dl-8">dl</a></code> element, does not indicate that its contents are a
1.12      mike     1005:   term being defined, but this can be indicated using the
1.264     mike     1006:   <code><a href="text-level-semantics.html#the-dfn-element" id="dfn-2">dfn</a></code> element.<div class="example">
1.23      mike     1007: 
                   1008:    <p>This example shows a list of frequently asked questions (a FAQ)
1.264     mike     1009:    marked up using the <code><a href="#the-dt-element" id="dt-5">dt</a></code> element for questions and the
                   1010:    <code><a href="#the-dd-element" id="dd-3">dd</a></code> element for answers.</p>
1.23      mike     1011: 
                   1012:    <pre>&lt;article&gt;
                   1013:  &lt;h1&gt;FAQ&lt;/h1&gt;
                   1014:  &lt;dl&gt;
                   1015:   &lt;dt&gt;What do we want?&lt;/dt&gt;
                   1016:   &lt;dd&gt;Our data.&lt;/dd&gt;
                   1017:   &lt;dt&gt;When do we want it?&lt;/dt&gt;
                   1018:   &lt;dd&gt;Now.&lt;/dd&gt;
                   1019:   &lt;dt&gt;Where is it?&lt;/dt&gt;
                   1020:   &lt;dd&gt;We are not sure.&lt;/dd&gt;
                   1021:  &lt;/dl&gt;
                   1022: &lt;/article&gt;</pre>
                   1023: 
1.204     mike     1024:   </div><h4 id="the-dd-element"><span class="secno">4.5.10 </span>The <dfn><code>dd</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.12      mike     1025:    <dd>None.</dd>
1.205     mike     1026:    <dt>Contexts in which this element can be used:</dt>
1.264     mike     1027:    <dd>After <code><a href="#the-dt-element" id="dt-6">dt</a></code> or <code><a href="#the-dd-element" id="dd-4">dd</a></code> elements inside <code><a href="#the-dl-element" id="dl-9">dl</a></code> elements.</dd>
1.12      mike     1028:    <dt>Content model:</dt>
1.205     mike     1029:    <dd><a href="content-models.html#flow-content" id="flow-content-56">Flow content</a>.</dd>
1.12      mike     1030:    <dt>Content attributes:</dt>
1.159     mike     1031:    <dd><a href="elements.html#global-attributes" id="global-attributes-28">Global attributes</a></dd>
1.12      mike     1032:    <dt>DOM interface:</dt>
1.159     mike     1033:    <dd>Uses <code><a href="elements.html#htmlelement" id="htmlelement-35">HTMLElement</a></code>.</dd>
1.264     mike     1034:   </dl><p>The <code><a href="#the-dd-element" id="dd-5">dd</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> the
1.12      mike     1035:   description, definition, or value, part of a term-description group
1.264     mike     1036:   in a description list (<code><a href="#the-dl-element" id="dl-10">dl</a></code> element).<div class="example">
1.12      mike     1037: 
1.264     mike     1038:    <p>A <code><a href="#the-dl-element" id="dl-11">dl</a></code> can be used to define a vocabulary list, like
1.12      mike     1039:    in a dictionary. In the following example, each entry, given by a
1.264     mike     1040:    <code><a href="#the-dt-element" id="dt-7">dt</a></code> with a <code><a href="text-level-semantics.html#the-dfn-element" id="dfn-3">dfn</a></code>, has several
                   1041:    <code><a href="#the-dd-element" id="dd-6">dd</a></code>s, showing the various parts of the definition.</p>
1.12      mike     1042: 
                   1043:    <!-- the actual pronunciations below are nonsense. -->
                   1044:    <pre>&lt;dl&gt;
                   1045:  &lt;dt&gt;&lt;dfn&gt;happiness&lt;/dfn&gt;&lt;/dt&gt;
1.163     mike     1046:  &lt;dd class="pronunciation"&gt;/'h&aelig; p. nes/&lt;/dd&gt;
1.12      mike     1047:  &lt;dd class="part-of-speech"&gt;&lt;i&gt;&lt;abbr&gt;n.&lt;/abbr&gt;&lt;/i&gt;&lt;/dd&gt;
                   1048:  &lt;dd&gt;The state of being happy.&lt;/dd&gt;
                   1049:  &lt;dd&gt;Good fortune; success. &lt;q&gt;Oh &lt;b&gt;happiness&lt;/b&gt;! It worked!&lt;/q&gt;&lt;/dd&gt;
                   1050:  &lt;dt&gt;&lt;dfn&gt;rejoice&lt;/dfn&gt;&lt;/dt&gt;
                   1051:  &lt;dd class="pronunciation"&gt;/ri jois'/&lt;/dd&gt;
                   1052:  &lt;dd&gt;&lt;i class="part-of-speech"&gt;&lt;abbr&gt;v.intr.&lt;/abbr&gt;&lt;/i&gt; To be delighted oneself.&lt;/dd&gt;
                   1053:  &lt;dd&gt;&lt;i class="part-of-speech"&gt;&lt;abbr&gt;v.tr.&lt;/abbr&gt;&lt;/i&gt; To cause one to be delighted.&lt;/dd&gt;
                   1054: &lt;/dl&gt;</pre>
1.204     mike     1055:   </div><h4 id="the-figure-element"><span class="secno">4.5.11 </span>The <dfn><code>figure</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike     1056:    <dd><a href="content-models.html#flow-content" id="flow-content-57">Flow content</a>.</dd>
1.159     mike     1057:    <dd><a href="sections.html#sectioning-root" id="sectioning-root-7">Sectioning root</a>.</dd>
1.205     mike     1058:    <dt>Contexts in which this element can be used:</dt>
                   1059:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-58">flow content</a> is expected.</dd>
1.17      mike     1060:    <dt>Content model:</dt>
1.264     mike     1061:    <dd>Either: One <code><a href="#the-figcaption-element" id="figcaption-0">figcaption</a></code> element followed by <a href="content-models.html#flow-content" id="flow-content-59">flow content</a>.</dd>
                   1062:    <dd>Or: <a href="content-models.html#flow-content" id="flow-content-60">Flow content</a> followed by one <code><a href="#the-figcaption-element" id="figcaption-1">figcaption</a></code> element.</dd>
1.205     mike     1063:    <dd>Or: <a href="content-models.html#flow-content" id="flow-content-61">Flow content</a>.</dd>
1.17      mike     1064:    <dt>Content attributes:</dt>
1.159     mike     1065:    <dd><a href="elements.html#global-attributes" id="global-attributes-29">Global attributes</a></dd>
1.17      mike     1066:    <dt>DOM interface:</dt>
1.159     mike     1067:    <dd>Uses <code><a href="elements.html#htmlelement" id="htmlelement-36">HTMLElement</a></code>.</dd>
1.264     mike     1068:   </dl><!-- v2: Add a <credit> element for photo credits --><p>The <code><a href="#the-figure-element" id="figure-2">figure</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> some
1.205     mike     1069:   <a href="content-models.html#flow-content" id="flow-content-62">flow content</a>, optionally with a caption, that is
1.17      mike     1070:   self-contained and is typically referenced as a single unit from the
1.163     mike     1071:   main flow of the document.<p>The element can thus be used to annotate illustrations, diagrams,
1.17      mike     1072:   photos, code listings, etc, that are referred to from the main
                   1073:   content of the document, but that could, without affecting the flow
                   1074:   of the document, be moved away from that primary content, e.g. to
1.264     mike     1075:   the side of the page, to dedicated pages, or to an appendix.<p>The  <code><a href="#the-figcaption-element" id="figcaption-2">figcaption</a></code>
1.17      mike     1076:   element child of the element, if any, represents the caption of the
1.264     mike     1077:   <code><a href="#the-figure-element" id="figure-3">figure</a></code> element's contents. If there is no child
                   1078:   <code><a href="#the-figcaption-element" id="figcaption-3">figcaption</a></code> element, then there is no caption.<div class="example">
1.17      mike     1079: 
1.264     mike     1080:    <p>This example shows the <code><a href="#the-figure-element" id="figure-4">figure</a></code> element to mark up a
1.17      mike     1081:    code listing.</p>
                   1082: 
                   1083:    <pre>&lt;p&gt;In &lt;a href="#l4"&gt;listing 4&lt;/a&gt; we see the primary core interface
                   1084: API declaration.&lt;/p&gt;
                   1085: &lt;figure id="l4"&gt;
                   1086:  &lt;figcaption&gt;Listing 4. The primary core interface API declaration.&lt;/figcaption&gt;
                   1087:  &lt;pre&gt;&lt;code&gt;interface PrimaryCore {
                   1088:  boolean verifyDataLine();
                   1089:  void sendData(in sequence&amp;lt;byte&gt; data);
                   1090:  void initSelfDestruct();
                   1091: }&lt;/code&gt;&lt;/pre&gt;
                   1092: &lt;/figure&gt;
                   1093: &lt;p&gt;The API is designed to use UTF-8.&lt;/p&gt;</pre>
                   1094: 
                   1095:   </div><div class="example">
                   1096: 
1.264     mike     1097:    <p>Here we see a <code><a href="#the-figure-element" id="figure-5">figure</a></code> element to mark up a
1.17      mike     1098:    photo.</p>
                   1099: 
                   1100:    <pre>&lt;figure&gt;
                   1101:  &lt;img src="bubbles-work.jpeg"
                   1102:       alt="Bubbles, sitting in his office chair, works on his
                   1103:            latest project intently."&gt;
                   1104:  &lt;figcaption&gt;Bubbles at work&lt;/figcaption&gt;
                   1105: &lt;/figure&gt;</pre>
                   1106: 
                   1107:   </div><div class="example">
                   1108: 
                   1109:    <p>In this example, we see an image that is <em>not</em>
                   1110:    a figure, as well as an image and a video that are.</p>
                   1111: 
                   1112:    <pre>&lt;h2&gt;Malinko's comics&lt;/h2&gt;
                   1113: 
                   1114: &lt;p&gt;This case centered on some sort of "intellectual property"
                   1115: infringement related to a comic (see Exhibit A). The suit started
                   1116: after a trailer ending with these words:
                   1117: 
                   1118: &lt;blockquote&gt;
                   1119:  &lt;img src="promblem-packed-action.png" alt="ROUGH COPY! Promblem-Packed Action!"&gt;
                   1120: &lt;/blockquote&gt;
                   1121: 
                   1122: &lt;p&gt;...was aired. A lawyer, armed with a Bigger Notebook, launched a
                   1123: preemptive strike using snowballs. A complete copy of the trailer is
                   1124: included with Exhibit B.
                   1125: 
                   1126: &lt;figure&gt;
                   1127:  &lt;img src="ex-a.png" alt="Two squiggles on a dirty piece of paper."&gt;
                   1128:  &lt;figcaption&gt;Exhibit A. The alleged &lt;cite&gt;rough copy&lt;/cite&gt; comic.&lt;/figcaption&gt;
                   1129: &lt;/figure&gt;
                   1130: 
                   1131: &lt;figure&gt;
                   1132:  &lt;video src="ex-b.mov"&gt;&lt;/video&gt;
                   1133:  &lt;figcaption&gt;Exhibit B. The &lt;cite&gt;Rough Copy&lt;/cite&gt; trailer.&lt;/figcaption&gt;
                   1134: &lt;/figure&gt;
                   1135: 
                   1136: &lt;p&gt;The case was resolved out of court.</pre>
                   1137: 
                   1138:   </div><div class="example">
                   1139: 
                   1140:    <p>Here, a part of a poem is marked up using
1.264     mike     1141:    <code><a href="#the-figure-element" id="figure-6">figure</a></code>.</p>
1.17      mike     1142: 
                   1143:    <pre>&lt;figure&gt;
                   1144:  &lt;p&gt;'Twas brillig, and the slithy toves&lt;br&gt;
                   1145:  Did gyre and gimble in the wabe;&lt;br&gt;
                   1146:  All mimsy were the borogoves,&lt;br&gt;
                   1147:  And the mome raths outgrabe.&lt;/p&gt;
                   1148:  &lt;figcaption&gt;&lt;cite&gt;Jabberwocky&lt;/cite&gt; (first verse). Lewis Carroll, 1832-98&lt;/figcaption&gt;
                   1149: &lt;/figure&gt;</pre>
                   1150: 
                   1151:   </div><div class="example">
                   1152: 
                   1153:    <p>In this example, which could be part of a much larger work
                   1154:    discussing a castle, the figure has three images in it.</p>
                   1155: 
                   1156:    <pre>&lt;figure&gt;
                   1157:  &lt;img src="castle1423.jpeg" title="Etching. Anonymous, ca. 1423."
                   1158:       alt="The castle has one tower, and a tall wall around it."&gt;
                   1159:  &lt;img src="castle1858.jpeg" title="Oil-based paint on canvas. Maria Towle, 1858."
                   1160:       alt="The castle now has two towers and two walls."&gt;
                   1161:  &lt;img src="castle1999.jpeg" title="Film photograph. Peter Jankle, 1999."
                   1162:       alt="The castle lies in ruins, the original tower all that remains in one piece."&gt;
                   1163:  &lt;figcaption&gt;The castle through the ages: 1423, 1858, and 1999 respectively.&lt;/figcaption&gt;
                   1164: &lt;/figure&gt;</pre>
                   1165: 
1.27      mike     1166:   </div><h4 id="the-figcaption-element"><span class="secno">4.5.12 </span>The <dfn><code>figcaption</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.17      mike     1167:    <dd>None.</dd>
1.205     mike     1168:    <dt>Contexts in which this element can be used:</dt>
1.264     mike     1169:    <dd>As the first or last child of a <code><a href="#the-figure-element" id="figure-7">figure</a></code> element.</dd>
1.17      mike     1170:    <dt>Content model:</dt>
1.205     mike     1171:    <dd><a href="content-models.html#flow-content" id="flow-content-63">Flow content</a>.</dd>
1.17      mike     1172:    <dt>Content attributes:</dt>
1.159     mike     1173:    <dd><a href="elements.html#global-attributes" id="global-attributes-30">Global attributes</a></dd>
1.17      mike     1174:    <dt>DOM interface:</dt>
1.159     mike     1175:    <dd>Uses <code><a href="elements.html#htmlelement" id="htmlelement-37">HTMLElement</a></code>.</dd>
1.264     mike     1176:   </dl><p>The <code><a href="#the-figcaption-element" id="figcaption-4">figcaption</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a
1.17      mike     1177:   caption or legend for the rest of the contents of the
1.264     mike     1178:   <code><a href="#the-figcaption-element" id="figcaption-5">figcaption</a></code> element's parent <code><a href="#the-figure-element" id="figure-8">figure</a></code>
1.204     mike     1179:   element.<h4 id="the-div-element"><span class="secno">4.5.13 </span>The <dfn><code>div</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.205     mike     1180:    <dd><a href="content-models.html#flow-content" id="flow-content-64">Flow content</a>.</dd>
1.159     mike     1181:    <dd><a href="dnd.html#formatblock-candidate" id="formatblock-candidate-12"><code title="">formatBlock</code> candidate</a>.</dd>
1.205     mike     1182:    <dt>Contexts in which this element can be used:</dt>
                   1183:    <dd>Where <a href="content-models.html#flow-content" id="flow-content-65">flow content</a> is expected.</dd>
1.12      mike     1184:    <dt>Content model:</dt>
1.205     mike     1185:    <dd><a href="content-models.html#flow-content" id="flow-content-66">Flow content</a>.</dd>
1.12      mike     1186:    <dt>Content attributes:</dt>
1.159     mike     1187:    <dd><a href="elements.html#global-attributes" id="global-attributes-31">Global attributes</a></dd>
1.12      mike     1188:    <dt>DOM interface:</dt>
                   1189:    <dd>
1.159     mike     1190:     <pre class="idl">interface <dfn id="htmldivelement">HTMLDivElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-38">HTMLElement</a> {};</pre>
1.12      mike     1191:    </dd>
1.264     mike     1192:   </dl><p>The <code><a href="#the-div-element" id="div-8">div</a></code> element has no special meaning at all. It
1.165     mike     1193:   <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> its children. It can be used with the <code title="attr-class"><a href="elements.html#classes" id="class-4">class</a></code>, <code title="attr-lang"><a href="elements.html#attr-lang" id="lang-7">lang</a></code>, and <code title="attr-title"><a href="elements.html#the-title-attribute" id="title-9">title</a></code> attributes to mark up semantics
1.163     mike     1194:   common to a group of consecutive elements.<p class="note">Authors are strongly encouraged to view the
1.264     mike     1195:   <code><a href="#the-div-element" id="div-9">div</a></code> element as an element of last resort, for when no
                   1196:   other element is suitable. Use of the <code><a href="#the-div-element" id="div-10">div</a></code> element
1.12      mike     1197:   instead of more appropriate elements leads to poor accessibility for
1.163     mike     1198:   readers and poor maintainability for authors.<div class="example">
1.12      mike     1199: 
                   1200:    <p>For example, a blog post would be marked up using
1.159     mike     1201:    <code><a href="sections.html#the-article-element" id="article-15">article</a></code>, a chapter using <code><a href="sections.html#the-section-element" id="section-12">section</a></code>, a
                   1202:    page's navigation aids using <code><a href="sections.html#the-nav-element" id="nav-8">nav</a></code>, and a group of form
1.264     mike     1203:    controls using <code><a href="forms.html#the-fieldset-element" id="fieldset-3">fieldset</a></code>.</p>
1.12      mike     1204: 
1.264     mike     1205:    <p>On the other hand, <code><a href="#the-div-element" id="div-11">div</a></code> elements can be useful for
1.12      mike     1206:    stylistic purposes or to wrap multiple paragraphs within a section
                   1207:    that are all to be annotated in a similar way. In the following
1.264     mike     1208:    example, we see <code><a href="#the-div-element" id="div-12">div</a></code> elements used as a way to set the
1.12      mike     1209:    language of two paragraphs at once, instead of setting the language
                   1210:    on the two paragraph elements separately:</p>
                   1211: 
                   1212:    <pre>&lt;article lang="en-US"&gt;
                   1213:  &lt;h1&gt;My use of language and my cats&lt;/h1&gt;
                   1214:  &lt;p&gt;My cat's behavior hasn't changed much since her absence, except
                   1215:  that she plays her new physique to the neighbors regularly, in an
                   1216:  attempt to get pets.&lt;/p&gt;
                   1217:  &lt;div lang="en-GB"&gt;
                   1218:   &lt;p&gt;My other cat, coloured black and white, is a sweetie. He followed
                   1219:   us to the pool today, walking down the pavement with us. Yesterday
                   1220:   he apparently visited our neighbours. I wonder if he recognises that
                   1221:   their flat is a mirror image of ours.&lt;/p&gt;
                   1222:   &lt;p&gt;Hm, I just noticed that in the last paragraph I used British
                   1223:   English. But I'm supposed to write in American English. So I
                   1224:   shouldn't say "pavement" or "flat" or "colour"...&lt;/p&gt;
                   1225:  &lt;/div&gt;
                   1226:  &lt;p&gt;I should say "sidewalk" and "apartment" and "color"!&lt;/p&gt;
                   1227: &lt;/article&gt;</pre>
                   1228: 
1.163     mike     1229:   </div>

Webmaster