-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.html
675 lines (566 loc) · 40.3 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en"><head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Display Module Level 3</title>
<link href="../default.css" type="text/css" rel="stylesheet">
<link href="../csslogo.ico" type="image/x-icon" rel="shortcut icon">
<link href="https://www.w3.org/StyleSheets/TR/W3C-ED.css" type="text/css" rel="stylesheet">
</head>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a href="http://www.w3.org/">
<img width="72" alt="W3C" src="http://www.w3.org/Icons/w3c_home" height="48">
</a></p>
<h1 class="p-name no-ref" id="title">CSS Display Module Level 3</h1>
<h2 class="no-num no-toc no-ref" id="subtitle">Editor's Draft,
<span class="dt-updated"><span class="value-title" title="20130503">3 May 2013</span></span></h2>
<div data-fill-with="spec-metadata"><dl><dt>This version:</dt><dd><a href="http://dev.w3.org/csswg/css-display" class="u-url">http://dev.w3.org/csswg/css-display</a></dd><dt>Editor's Draft:</dt><dd><a href="http://dev.w3.org/csswg/css-display">http://dev.w3.org/csswg/css-display</a>
</dd><dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-display%5D%20feedback">www-style@w3.org</a>
with subject line
“<kbd>[css-display] <var>… message topic …</var></kbd>”
(<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</dd><dt>Editors:
</dt><dd class="p-author h-card vcard"><a href="http://xanthir.com/contact/" class="p-name fn u-url url">Tab Atkins Jr.</a> (<span class="p-org org">Google</span>)</dd></dl></div>
<div data-fill-with="warning"></div>
<p data-fill-with="copyright" class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright" rel="license">Copyright</a> © 2013
<a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
(
<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
<a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>,
<a href="http://ev.buaa.edu.cn/">Beihang</a>
),
All Rights Reserved.
W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
<hr title="Separator for header">
</div>
<h2 id="abstract" class="no-num no-toc no-ref">Abstract</h2>
<p data-fill-with="abstract" class="p-summary">This module contains the features of CSS relating to the <a data-autolink="property" class="property" title="display" href="#display">display</a> property and other box-generation details.
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</p>
<h2 id="status" class="no-num no-toc no-ref">Status of this document</h2>
<div data-fill-with="status"><p>
This is a public copy of the editors' draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don't cite this document other than as work in progress.
</p><p>
The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-display%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href="http://www.w3.org/Mail/Request">instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-display” in the subject,
preferably like this:
“[css-display] <em>…summary of comment…</em>”
</p><p>
This document was produced by the <a href="/Style/CSS/members">CSS Working Group</a>
(part of the <a href="/Style/">Style Activity</a>).
</p><p>
This document was produced by a group operating under
the <a href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href="/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a>
made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href="/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with <a href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.</p></div>
<div data-fill-with="at-risk"></div>
<h2 id="contents" class="no-num no-toc no-ref">Table of contents</h2>
<div data-fill-with="table-of-contents"><ul class="toc"><li><a href="#intro"><span class="secno">1 </span>
Introduction</a><ul class="toc"><li><a href="#placement"><span class="secno">1.1 </span>
Module interactions</a></li><li><a href="#values"><span class="secno">1.2 </span>
Values</a></li></ul></li><li><a href="#the-display-properties"><span class="secno">2 </span>
The Display Properties</a><ul class="toc"><li><a href="#the-display-inside"><span class="secno">2.1 </span>
Setting the layout mode: the <span data-autolink="property" class="property" title="display-inside">display-inside</span> property</a></li><li><a href="#the-display-outside"><span class="secno">2.2 </span>
Interacting with the layout mode: the <span data-autolink="property" class="property" title="display-outside">display-outside</span> property</a></li><li><a href="#the-display-extras"><span class="secno">2.3 </span>
Additional stuff: the <span data-autolink="property" class="property" title="display-extras">display-extras</span> property</a></li><li><a href="#the-display"><span class="secno">2.4 </span>
The <span data-autolink="property" class="property" title="display">display</span> shorthand property</a></li></ul></li><li><a href="#the-display-box"><span class="secno">3 </span>
Controlling box generation: the <span data-autolink="property" class="property" title="box">box</span> property</a></li><li><a href="#acknowledgments">
Acknowledgments</a></li><li><a href="#conformance">
Conformance</a><ul class="toc"><li><a href="#conventions">
Document conventions</a></li><li><a href="#conformance-classes">
Conformance classes</a></li><li><a href="#partial">
Partial implementations</a></li><li><a href="#experimental">
Experimental implementations</a></li><li><a href="#testing">
Non-experimental implementations</a></li></ul></li><li><a href="#references">
References</a><ul class="toc"><li><a href="#normative">
Normative References</a></li><li><a href="#informative">
Informative References</a></li></ul></li><li><a href="#index">
Index</a></li><li><a href="#property-index">
Property index</a></li></ul></div>
<h2 id="intro" data-level="1"><span class="secno">1 </span>
Introduction</h2>
<p><em>This section is not normative.</em>
</p><p> The <a data-autolink="property" class="property" title="display" href="#display">display</a> property, introduced in CSS 2.1,
defines what kind of boxes an element generates
(and whether it generates boxes at all),
and how it lays out its contents.
</p><p> These concepts are actually rather independent,
though they're conflated by the <a data-autolink="property" class="property" title="display" href="#display">display</a> property.
This causes some pain when a property value intended to affect one aspect
(such as setting an element to <a data-autolink="maybe" class="css">display:none</a> to suppress box generation)
affects another aspect
(such as losing the memory of what it was <em>before</em> <a data-autolink="maybe" class="css">display:none</a>,
so that it can be set back to that value later).
</p><p> This specification subsumes the CSS 2.1 definition of the <a data-autolink="property" class="property" title="display" href="#display">display</a> property,
and redefines it to be a shorthand property for a small family of longhands,
each controlling an independent aspect of an element's "display".
</p><h3 id="placement" data-level="1.1"><span class="secno">1.1 </span>
Module interactions</h3>
<p> This specification transforms the <a data-autolink="property" class="property" title="display" href="#display">display</a> property into a shorthand property,
and defines several longhand properties that it expands into or effects.
</p><p> This module replaces and extends the definition of the <a data-autolink="property" class="property" title="display" href="#display">display</a> property defined in <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a> section 9.2.4.
</p><p> None of the properties in this module apply to the <code>::first-line</code> or <code>::first-letter</code> pseudo-elements.
</p><h3 id="values" data-level="1.2"><span class="secno">1.2 </span>
Values</h3>
<p> This specification follows the
<a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property
definition conventions</a> from <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>. Value types not defined in
this specification are defined in CSS Level 2 Revision 1 <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>.
Other CSS modules may expand the definitions of these value types.
</p><p> In addition to the property-specific values listed in their definitions,
all properties defined in this specification also accept the
<a href="http://www.w3.org/TR/css3-values/#common-keywords">CSS-wide keywords</a>
as their property value. For readability it has not been repeated explicitly.
</p><h2 id="the-display-properties" data-level="2"><span class="secno">2 </span>
The Display Properties</h2>
<p> The <a data-autolink="property" class="property" title="display" href="#display">display</a> shorthand and its associated family of properties control the layout mode of elements
(how the element determines the sizes and positions of itself and its descendants),
and what boxes they and their descendants generate.
</p><h3 id="the-display-inside" data-level="2.1"><span class="secno">2.1 </span>
Setting the layout mode: the <a data-autolink="property" class="property" title="display-inside" href="#display-inside">display-inside</a> property</h3>
<table class="propdef">
<tbody><tr>
<th>Name:
</th><td><dfn id="display-inside">display-inside</dfn></td></tr><tr>
<th>Value:
</th><td>auto | block | table | flex | grid
</td></tr><tr>
<th>Initial:
</th><td>auto
</td></tr><tr>
<th>Applies To:
</th><td>all elements
</td></tr><tr>
<th>Inherited:
</th><td>no
</td></tr><tr>
<th>Percentages:
</th><td>N/A
</td></tr><tr>
<th>Computed Value:
</th><td>a keyword
</td></tr></tbody></table>
<dl>
<dt><dfn id="display-inside-auto">auto</dfn>
</dt><dd>
If the element's computed <a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a> value is <a data-autolink="maybe" class="css" href="#display-outside-inline-level">inline-level</a>,
the element is an <a data-autolink="link">inline element</a>,
and lays out its contents using inline layout. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>
If the element's computed <a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a> value is <a data-autolink="maybe" class="css" href="#display-outside-table-row-group">table-row-group</a>, <a data-autolink="maybe" class="css" href="#display-outside-table-header-group">table-header-group</a>, <a data-autolink="maybe" class="css" href="#display-outside-table-footer-group">table-footer-group</a>, <a data-autolink="maybe" class="css" href="#display-outside-table-row">table-row</a>, <a data-autolink="maybe" class="css" href="#display-outside-table-column-group">table-column-group</a>, or <a data-autolink="maybe" class="css" href="#display-outside-table-column">table-column</a>,
this elements acts as normal for its given <a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a> value.
Otherwise, this value computes to <a data-autolink="maybe" class="css" href="#display-inside-block">block</a>.
</dd><dt><dfn id="display-inside-block">block</dfn>
</dt><dd>
The element lays out its contents using block layout. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>
</dd><dt><dfn id="display-inside-table">table</dfn>
</dt><dd>
The element lays out its contents using table layout. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>
</dd><dt><dfn id="display-inside-flex">flex</dfn>
</dt><dd>
The element lays out its contents using flex layout. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS3-FLEXBOX" href="#css3-flexbox">[CSS3-FLEXBOX]</a>
</dd><dt><dfn id="display-inside-grid">grid</dfn>
</dt><dd>
The element lays out its contents using grid layout. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS3-GRID-LAYOUT" href="#css3-grid-layout">[CSS3-GRID-LAYOUT]</a>
</dd></dl>
<h3 id="the-display-outside" data-level="2.2"><span class="secno">2.2 </span>
Interacting with the layout mode: the <a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a> property</h3>
<table class="propdef">
<tbody><tr>
<th>Name:
</th><td><dfn id="display-outside">display-outside</dfn></td></tr><tr>
<th>Value:
</th><td>block-level | inline-level | none | table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption
</td></tr><tr>
<th>Initial:
</th><td>inline-level
</td></tr><tr>
<th>Applies To:
</th><td>all elements
</td></tr><tr>
<th>Inherited:
</th><td>no
</td></tr><tr>
<th>Percentages:
</th><td>N/A
</td></tr><tr>
<th>Computed Value:
</th><td>as specified
</td></tr></tbody></table>
<dl>
<dt><dfn id="display-outside-block-level"><a data-autolink="maybe" class="css" href="#display-outside-block-level">block-level</a></dfn>
</dt><dd>
The element is <a data-autolink="link" href="#display-outside-block-level">block-level</a>,
and participates in a block formatting context.
Other formatting contexts,
such as flex formatting contexts,
may also work with <a data-autolink="link" href="#display-outside-block-level">block-level</a> elements. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>
</dd><dt><dfn id="display-outside-inline-level"><a data-autolink="maybe" class="css" href="#display-outside-inline-level">inline-level</a></dfn>
</dt><dd>
The element is <a data-autolink="link" href="#display-outside-inline-level">inline-level</a>,
and participates in an inline formatting context. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>
</dd><dt><dfn id="display-outside-none"><a data-autolink="maybe" class="css" href="#display-outside-none">none</a></dfn>
</dt><dd>
The element generates no boxes,
and does not participate in any formatting context.
<p class="note"> Note: This value exists for legacy reasons,
and interacts with the separate <a data-autolink="property" class="property" title="box" href="#box">box</a> property.
It is recommended that <a data-autolink="property" class="property" title="box" href="#box">box</a> be used to suppress an element,
so that the element's display type is automatically preserved
for when it's no longer suppressed.
</p></dd><dt><dfn id="display-outside-table-row-group"><a data-autolink="maybe" class="css" href="#display-outside-table-row-group">table-row-group</a></dfn>, <dfn id="display-outside-table-header-group"><a data-autolink="maybe" class="css" href="#display-outside-table-header-group">table-header-group</a></dfn>, <dfn id="display-outside-table-footer-group"><a data-autolink="maybe" class="css" href="#display-outside-table-footer-group">table-footer-group</a></dfn>, <dfn id="display-outside-table-row"><a data-autolink="maybe" class="css" href="#display-outside-table-row">table-row</a></dfn>, <dfn id="display-outside-table-cell"><a data-autolink="maybe" class="css" href="#display-outside-table-cell">table-cell</a></dfn>, <dfn id="display-outside-table-column-group"><a data-autolink="maybe" class="css" href="#display-outside-table-column-group">table-column-group</a></dfn>, <dfn id="display-outside-table-column"><a data-autolink="maybe" class="css" href="#display-outside-table-column">table-column</a></dfn>, <dfn id="display-outside-table-caption"><a data-autolink="maybe" class="css" href="#display-outside-table-caption">table-caption</a></dfn>
</dt><dd>
The element is an internal table element,
and participates in a table layout context. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>
</dd></dl>
<p class="issue">
Do we need special bits about some of the interactions with <a data-autolink="property" class="property" title="display-inside" href="#display-inside">display-inside</a>?
For example, how <a data-autolink="maybe" class="css">display:inline-level block;</a> works?
Or does that fall out of what exists,
and the definitions of Block Layout in 2.1?
(...or a new Block Layout spec, explaining all the 2.1 stuff more sanely?)
</p><p class="issue">
Is <a href="http://lists.w3.org/Archives/Public/www-style/2012Jul/0450.html">fantasai's proposal for a run-in model</a> sane enough to include in this spec?
</p><h3 id="the-display-extras" data-level="2.3"><span class="secno">2.3 </span>
Additional stuff: the <a data-autolink="property" class="property" title="display-extras" href="#display-extras">display-extras</a> property</h3>
<table class="propdef">
<tbody><tr>
<th>Name:
</th><td><dfn id="display-extras">display-extras</dfn></td></tr><tr>
<th>Value:
</th><td>none | [ list-item ]
</td></tr><tr>
<th>Initial:
</th><td>none
</td></tr><tr>
<th>Applies To:
</th><td>all elements
</td></tr><tr>
<th>Inherited:
</th><td>no
</td></tr><tr>
<th>Percentages:
</th><td>N/A
</td></tr><tr>
<th>Computed Value:
</th><td>as specified
</td></tr></tbody></table>
<dl>
<dt><dfn id="display-extras-list-item">list-item</dfn>
</dt><dd>
The element generates a <code>::marker</code> pseudo-element
and is considered a <a data-autolink="link">list item</a>.
</dd></dl>
<p class="issue">
This property is probably dumb,
and at the very least has a dumb name.
Better names?
If I define more one-off weird box-generation details like this,
should I merge them into a single "extras" property like this,
or just have them all be separate properties?
</p><h3 id="the-display" data-level="2.4"><span class="secno">2.4 </span>
The <a data-autolink="property" class="property" title="display" href="#display">display</a> shorthand property</h3>
<table class="propdef">
<tbody><tr>
<th>Name:
</th><td><dfn id="display">display</dfn></td></tr><tr>
<th>Value:
</th><td>inline | block | list-item | inline-list-item | inline-block | table | inline-table | table-cell | table-caption | flex | inline-flex | grid | inline-grid | [ <<a data-autolink="property" class="property" title="display-inside" href="#display-inside">display-inside</a>> || <<a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a>> || <<a data-autolink="property" class="property" title="display-box">display-box</a>> || <<a data-autolink="property" class="property" title="display-extras" href="#display-extras">display-extras</a>> ]
</td></tr><tr>
<th>Initial:
</th><td>see individual properties
</td></tr><tr>
<th>Applies To:
</th><td>all elements
</td></tr><tr>
<th>Inherited:
</th><td>no
</td></tr><tr>
<th>Percentages:
</th><td>see individual properties
</td></tr><tr>
<th>Computed Value:
</th><td>see individual properties
</td></tr><tr>
<th>Animatable:
</th><td>see individual properties
</td></tr></tbody></table>
<p>
The single-keyword values listed explicitly in the grammar above are handled specially,
for legacy reasons.
All other single-keyword values,
and all other values in general,
are handled as normal for shorthands.
</p><p class="issue">
The general rule for new layout modes seems to be that they're block-level by default.
However, this conflicts with the default value of <a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a>, which is <a data-autolink="maybe" class="css" href="#display-outside-inline-level">inline-level</a>.
What's the best way to address this?
Simplest answer is to just expand this list of special values as we go along.
Another possibility is to magic up the expansion in a different way,
so that if the value is just a <a data-autolink="property" class="property" title="display-inside" href="#display-inside">display-inside</a> keyword,
<a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a> defaults to <a data-autolink="maybe" class="css" href="#display-outside-block-level">block-level</a>.
If the latter is chosen, we could remove several more of the special expansions below
(all the ones that are identical to a <a data-autolink="property" class="property" title="display-inside" href="#display-inside">display-inside</a> value).
</p><p class="note">
Several of the "special" expansions below are actually just what the shorthand would expand to normally.
They're included here for clarity,
as they're very familiar from long usage in CSS 2.1,
before the <a data-autolink="property" class="property" title="display" href="#display">display</a> property became a shorthand.
</p><dl>
<dt><dfn id="display-inline" title="">inline</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">inline-level auto</a>.
</dd><dt><dfn id="display-block" title="">block</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">block-level block</a>.
</dd><dt><dfn id="display-list-item" title="">list-item</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">block-level block list-item</a>.
</dd><dt><dfn id="display-inline-list-item" title="">inline-list-item</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">inline-level block list-item</a>.
</dd><dt><dfn id="display-inline-block" title="">inline-block</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">inline-level block</a>.
</dd><dt><dfn id="display-table" title="">table</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">block-level table</a>.
</dd><dt><dfn id="display-inline-table" title="">inline-table</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">inline-level table</a>.
</dd><dt><dfn id="display-table-caption" title="">table-caption</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">table-caption block</a>.
</dd><dt><dfn id="display-table-cell" title="">table-cell</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">table-cell block</a>.
</dd><dt><dfn id="display-flex" title="">flex</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">block-level flex</a>.
</dd><dt><dfn id="display-inline-flex" title="">inline-flex</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">inline-level flex</a>.
</dd><dt><dfn id="display-grid" title="">grid</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">block-level grid</a>.
</dd><dt><dfn id="display-inline-grid" title="">inline-grid</dfn>
</dt><dd>
Expands identically to <a data-autolink="maybe" class="css">inline-level grid</a>.
</dd></dl>
<h2 id="the-display-box" data-level="3"><span class="secno">3 </span>
Controlling box generation: the <a data-autolink="property" class="property" title="box" href="#box">box</a> property</h2>
<table class="propdef">
<tbody><tr>
<th>Name:
</th><td><dfn id="box">box</dfn></td></tr><tr>
<th>Value:
</th><td>normal | none | contents
</td></tr><tr>
<th>Initial:
</th><td>normal
</td></tr><tr>
<th>Applies To:
</th><td>all elements
</td></tr><tr>
<th>Inherited:
</th><td>no
</td></tr><tr>
<th>Percentages:
</th><td>N/A
</td></tr><tr>
<th>Computed Value:
</th><td>see prose
</td></tr></tbody></table>
<p> The <a data-autolink="property" class="property" title="box" href="#box">box</a> property is not part of the <a data-autolink="property" class="property" title="display" href="#display">display</a> shorthand,
so that <a data-autolink="property" class="property" title="display" href="#display">display</a> can be safely set without accidentally overriding whether an element is being suppressed or not.
</p><p> The computed value of <a data-autolink="property" class="property" title="box" href="#box">box</a> is the specified value,
unless <a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a> has the value <a data-autolink="maybe" class="css" href="#display-outside-none">none</a>,
in which case the computed value of <a data-autolink="property" class="property" title="box" href="#box">box</a> is <a data-autolink="maybe" class="css" href="#display-outside-none">none</a> as well.
</p><dl>
<dt><dfn id="display-box-normal">normal</dfn>
</dt><dd>
The element generates boxes as normal,
per its other <a data-autolink="property" class="property" title="display-*">display-*</a> properties.
</dd><dt><dfn id="display-box-none" title="box:none">none</dfn>
</dt><dd>
The element generates no boxes at all.
</dd><dt><dfn id="display-box-contents">contents</dfn>
</dt><dd>
The element itself does not generate any boxes,
but its children and pseudo-elements still generate boxes as normal.
For the purposes of box generation and layout,
the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.
</dd></dl>
<p class="issue">
Is there a need for a value that suppresses box generation for layout purposes,
but still generates them for the purposes of animations/counters/etc.?
</p><p class="issue">
<a data-autolink="maybe" class="css" href="#display-box-contents">contents</a> currently only has an effect on box generation and layout.
Other things that care about the document tree are unaffected, like counter scopes.
Is this what we want?
</p><p class="issue">
Is <a data-autolink="property" class="property" title="box" href="#box">box</a> a good name? What about <a data-autolink="property" class="property" title="show">show</a>? Other suggestions?
</p><h2 id="acknowledgments" class="no-num">
Acknowledgments</h2>
<p> We would like to thank the many people who have attempted to separate out the disparate details of box generation over the years,
most particularly Bert Bos,
whose last attempt with <a data-autolink="property" class="property" title="display-model">display-model</a> and <a data-autolink="property" class="property" title="display-role">display-role</a> didn't get anywhere,
but primed us for the current spec.
</p><p> We would also like to thank the many JavaScript libraries such as jQuery which have hacked around the "what <a data-autolink="property" class="property" title="display" href="#display">display</a> should I give it when you call .show()?" problem, making it extremely clear that something needed to be done on our part.
</p><h2 class="no-ref no-num" id="conformance">
Conformance</h2>
<h3 class="no-ref" id="conventions">
Document conventions</h3>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words "MUST",
"MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification.
</p><p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="RFC2119" href="#rfc2119">[RFC2119]</a></p>
<p>Examples in this specification are introduced with the words "for example"
or are set apart from the normative text with <code>class="example"</code>,
like this:
</p><div class="example">
<p>This is an example of an informative example.</p>
</div>
<p>Informative notes begin with the word "Note" and are set apart from the
normative text with <code>class="note"</code>, like this:
</p><p class="note">Note, this is an informative note.</p>
<h3 class="no-ref" id="conformance-classes">
Conformance classes</h3>
<p>Conformance to this specification
is defined for three conformance classes:
</p><dl>
<dt><dfn data-noexport="" title="style sheet!!as conformance class" id="style-sheet">style sheet</dfn>
</dt><dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
style sheet</a>.
</dd><dt><dfn data-noexport="" id="renderer">renderer</dfn></dt>
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
that interprets the semantics of a style sheet and renders
documents that use them.
</dd><dt><dfn data-noexport="" id="authoring-tool">authoring tool</dfn></dt>
<dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
that writes a style sheet.
</dd></dl>
<p>A style sheet is conformant to this specification
if all of its statements that use syntax defined in this module are valid
according to the generic CSS grammar and the individual grammars of each
feature defined in this module.
</p><p>A renderer is conformant to this specification
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by this specification by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.)
</p><p>An authoring tool is conformant to this specification
if it writes style sheets that are syntactically correct according to the
generic CSS grammar and the individual grammars of each feature in
this module, and meet all other conformance requirements of style sheets
as described in this module.
</p><h3 class="no-ref" id="partial">
Partial implementations</h3>
<p>So that authors can exploit the forward-compatible parsing rules to
assign fallback values, CSS renderers <strong>must</strong>
treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore
as appropriate</a>) any at-rules, properties, property values, keywords,
and other syntactic constructs for which they have no usable level of
support. In particular, user agents <strong>must not</strong> selectively
ignore unsupported component values and honor supported values in a single
multi-value property declaration: if any value is considered invalid
(as unsupported values must be), CSS requires that the entire declaration
be ignored.</p>
<h3 class="no-ref" id="experimental">
Experimental implementations</h3>
<p>To avoid clashes with future CSS features, the CSS2.1 specification
reserves a <a href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
syntax</a> for proprietary and experimental extensions to CSS.
</p><p>Prior to a specification reaching the Candidate Recommendation stage
in the W3C process, all implementations of a CSS feature are considered
experimental. The CSS Working Group recommends that implementations
use a vendor-prefixed syntax for such features, including those in
W3C Working Drafts. This avoids incompatibilities with future changes
in the draft.
</p>
<h3 class="no-ref" id="testing">
Non-experimental implementations</h3>
<p>Once a specification reaches the Candidate Recommendation stage,
non-experimental implementations are possible, and implementors should
release an unprefixed implementation of any CR-level feature they
can demonstrate to be correctly implemented according to spec.
</p><p>To establish and maintain the interoperability of CSS across
implementations, the CSS Working Group requests that non-experimental
CSS renderers submit an implementation report (and, if necessary, the
testcases used for that implementation report) to the W3C before
releasing an unprefixed implementation of any CSS features. Testcases
submitted to W3C are subject to review and correction by the CSS
Working Group.
</p><p>Further information on submitting testcases and implementation reports
can be found from on the CSS Working Group's website at
<a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
Questions should be directed to the
<a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
mailing list.
</p><h2 id="references" class="no-num no-ref">
References</h2>
<h3 id="normative" class="no-num no-ref">
Normative References</h3>
<div data-fill-with="normative-references"><dl><dt id="css21" title="CSS21">[CSS21]</dt><dd>Bert Bos; et al. <a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a></dd><dt id="css3-flexbox" title="CSS3-FLEXBOX">[CSS3-FLEXBOX]</dt><dd>Tab Atkins Jr.; Elika J. Etemad; Alex Mogilevsky. <a href="http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/">CSS Flexible Box Layout Module</a>. 18 September 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href="http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/">http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/</a></dd><dt id="rfc2119" title="RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt">Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a></dd><dt id="css3-grid-layout" title="CSS3-GRID-LAYOUT">[CSS3-GRID-LAYOUT]</dt><dd>Alex Mogilevsky; et al. <a href="http://www.w3.org/TR/2012/WD-css3-grid-layout-20121106/">CSS Grid Layout</a>. 6 November 2012. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2012/WD-css3-grid-layout-20121106/">http://www.w3.org/TR/2012/WD-css3-grid-layout-20121106/</a></dd></dl></div>
<h3 id="informative" class="no-num no-ref">
Informative References</h3>
<div data-fill-with="informative-references"><dl></dl></div>
<h2 id="index" class="no-num no-ref">
Index</h2>
<div data-fill-with="index"><ul class="indexlist"><li>authoring tool, <a href="#authoring-tool" title="section ??">??</a></li><li>auto, <a href="#display-inside-auto" title="section 2.1">2.1</a></li><li>block, <a href="#display-inside-block" title="section 2.1">2.1</a></li><li>block-level, <a href="#display-outside-block-level" title="section 2.2">2.2</a></li><li>box, <a href="#box" title="section 3">3</a></li><li>box:none, <a href="#display-box-none" title="section 3">3</a></li><li>contents, <a href="#display-box-contents" title="section 3">3</a></li><li>display, <a href="#display" title="section 2.4">2.4</a></li><li>display-extras, <a href="#display-extras" title="section 2.3">2.3</a></li><li>display-inside, <a href="#display-inside" title="section 2.1">2.1</a></li><li>display-outside, <a href="#display-outside" title="section 2.2">2.2</a></li><li>flex, <a href="#display-inside-flex" title="section 2.1">2.1</a></li><li>grid, <a href="#display-inside-grid" title="section 2.1">2.1</a></li><li>inline-level, <a href="#display-outside-inline-level" title="section 2.2">2.2</a></li><li>list-item, <a href="#display-extras-list-item" title="section 2.3">2.3</a></li><li>none, <a href="#display-outside-none" title="section 2.2">2.2</a></li><li>normal, <a href="#display-box-normal" title="section 3">3</a></li><li>renderer, <a href="#renderer" title="section ??">??</a></li><li>style sheet!!as conformance class, <a href="#style-sheet" title="section ??">??</a></li><li>table, <a href="#display-inside-table" title="section 2.1">2.1</a></li><li>table-caption, <a href="#display-outside-table-caption" title="section 2.2">2.2</a></li><li>table-cell, <a href="#display-outside-table-cell" title="section 2.2">2.2</a></li><li>table-column, <a href="#display-outside-table-column" title="section 2.2">2.2</a></li><li>table-column-group, <a href="#display-outside-table-column-group" title="section 2.2">2.2</a></li><li>table-footer-group, <a href="#display-outside-table-footer-group" title="section 2.2">2.2</a></li><li>table-header-group, <a href="#display-outside-table-header-group" title="section 2.2">2.2</a></li><li>table-row, <a href="#display-outside-table-row" title="section 2.2">2.2</a></li><li>table-row-group, <a href="#display-outside-table-row-group" title="section 2.2">2.2</a></li></ul></div>
<h2 id="property-index" class="no-num no-ref">
Property index</h2>
<div data-fill-with="property-index"><table class="proptable"><thead><tr><th scope="col">Name</th><th scope="col">Values</th><th scope="col">Initial</th><th scope="col">Applies To</th><th scope="col">Inh.</th><th scope="col">%ages</th><th scope="col">Media</th><th scope="col">Computed Value</th><th scope="col">Animatable</th><th scope="col">Value</th></tr><tr><th scope="row"><a data-property="" data-autolink="link" href="#display-extras">display-extras</a></th><td></td><td>none
</td><td>all elements
</td><td>no
</td><td>N/A
</td><td></td><td>as specified
</td><td></td><td>none | [ list-item ]
</td></tr><tr><th scope="row"><a data-property="" data-autolink="link" href="#box">box</a></th><td></td><td>normal
</td><td>all elements
</td><td>no
</td><td>N/A
</td><td></td><td>see prose
</td><td></td><td>normal | none | contents
</td></tr><tr><th scope="row"><a data-property="" data-autolink="link" href="#display">display</a></th><td></td><td>see individual properties
</td><td>all elements
</td><td>no
</td><td>see individual properties
</td><td></td><td>see individual properties
</td><td>see individual properties
</td><td>inline | block | list-item | inline-list-item | inline-block | table | inline-table | table-cell | table-caption | flex | inline-flex | grid | inline-grid | [ <<a data-autolink="property" class="property" title="display-inside" href="#display-inside">display-inside</a>> || <<a data-autolink="property" class="property" title="display-outside" href="#display-outside">display-outside</a>> || <<a data-autolink="property" class="property" title="display-box">display-box</a>> || <<a data-autolink="property" class="property" title="display-extras" href="#display-extras">display-extras</a>> ]
</td></tr><tr><th scope="row"><a data-property="" data-autolink="link" href="#display-inside">display-inside</a></th><td></td><td>auto
</td><td>all elements
</td><td>no
</td><td>N/A
</td><td></td><td>a keyword
</td><td></td><td>auto | block | table | flex | grid
</td></tr><tr><th scope="row"><a data-property="" data-autolink="link" href="#display-outside">display-outside</a></th><td></td><td>inline-level
</td><td>all elements
</td><td>no
</td><td>N/A
</td><td></td><td>as specified
</td><td></td><td>block-level | inline-level | none | table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption
</td></tr></thead></table></div>
</body></html>