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