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