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