@@ -71,7 +71,7 @@ Controlling Layout Modes: the 'display' property</h2>
71
71
72
72
<pre class="propdef">
73
73
Name : display
74
- Value : [ <<display-inside>> || <<display-outside>> || list-item ] | <<display-internal>> | <<display-legacy>>
74
+ Value : [ <<display-inside>> || <<display-outside>> || list-item ] <<display-box>> | <<display-internal>> | <<display-legacy>>
75
75
Initial : inline
76
76
Applies to : all elements
77
77
Inherited : no
@@ -81,10 +81,16 @@ Controlling Layout Modes: the 'display' property</h2>
81
81
</pre>
82
82
83
83
<pre class='prod'>
84
- <dfn><display-inside></dfn> = auto | block | table | flex | grid | ruby ;
85
- <dfn><display-outside></dfn> = block-level | inline-level | run-in | contents | none ;
86
- <dfn><display-internal></dfn> = table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption | ruby-base | ruby-text | ruby-base-container | ruby-text-container ;
87
- <dfn><display-legacy></dfn> = inline | inline-list-item | inline-table | inline-flex | inline-grid ;
84
+ <dfn><display-inside></dfn> = flow | flow-root | table | flex | grid | ruby ;
85
+ <dfn><display-outside></dfn> = block | inline | run-in;
86
+ <dfn><display-box></dfn> = contents | none ;
87
+ <dfn><display-internal></dfn> = table-row-group | table-header-group |
88
+ table-footer-group | table-row | table-cell |
89
+ table-column-group | table-column | table-caption |
90
+ ruby-base | ruby-text | ruby-base-container |
91
+ ruby-text-container ;
92
+ <dfn><display-legacy></dfn> = inline-block | inline-list-item |
93
+ inline-table | inline-flex | inline-grid ;
88
94
</pre>
89
95
90
96
The 'display' property defines how an element generates boxes,
@@ -100,86 +106,91 @@ Controlling Layout Modes: the 'display' property</h2>
100
106
Additional, it controls some other box-generation details,
101
107
such as whether an element is a <a>list item</a> that generates a ''::marker'' pseudo-element.
102
108
109
+ <h3>
110
+ The Major Layout Modes</h3>
111
+
112
+ The most common values of display correspond directly to the major layout algorithms in CSS.
113
+
103
114
The <<display-inside>> keywords are defined as follows:
104
115
105
116
<dl dfn-type="value" dfn-for="display, <display-inside> ">
106
- <dt> <dfn>auto </dfn>
117
+ <dt> <dfn>flow </dfn>
107
118
<dd>
108
- If the element's computed <a>outer display type</a> value is ''inline-level'' ,
109
- the element is an inline element,
110
- and lays out its contents using inline layout. [[!CSS21]]
111
- Otherwise, this value computes to ''block'' .
119
+ The element lays out its contents using flow layout.
120
+ (Also known as "block" or "inline" layout.) [[!CSS21]]
112
121
113
- Issue: No need for ''auto'' anymore;
114
- just remove it, add a value specifically for ''display: inline'' ,
115
- and rewrite the other things that currently depend on it.
116
-
117
- <dt> <dfn>block</dfn>
122
+ <dt> <dfn>flow-root</dfn>
118
123
<dd>
119
- The element lays out its contents using block layout. [[!CSS21]]
120
-
121
- If <<display-outside>> is unspecified, it defaults to ''block-level'' .
124
+ The element lays out its contents using flow layout,
125
+ and establishes a <a>block formatting context</a> . [[!CSS21]]
122
126
123
127
<dt> <dfn>table</dfn>
124
128
<dd>
125
129
The element lays out its contents using table layout. [[!CSS21]]
126
130
127
- If <<display-outside>> is unspecified, it defaults to ''block-level'' .
128
-
129
131
<dt> <dfn>flex</dfn>
130
132
<dd>
131
133
The element lays out its contents using flex layout. [[!CSS3-FLEXBOX]]
132
134
133
- If <<display-outside>> is unspecified, it defaults to ''block-level'' .
134
-
135
135
<dt> <dfn>grid</dfn>
136
136
<dd>
137
137
The element lays out its contents using grid layout. [[!CSS3-GRID-LAYOUT]]
138
138
139
- If <<display-outside>> is unspecified, it defaults to ''block-level'' .
140
-
141
139
<dt> <dfn>ruby</dfn>
142
140
<dd>
143
141
The element lays out its contents using ruby layout. [[!CSS3RUBY]]
144
-
145
- If <<display-outside>> is unspecified, it defaults to ''inline-level'' .
146
142
</dl>
147
143
148
144
The <<display-outside>> keywords are defined as follows:
149
145
150
146
<dl dfn-type="value" dfn-for="display, <display-outside> ">
151
- <dt> <dfn>block-level </dfn>
147
+ <dt> <dfn>block</dfn>
152
148
<dd>
153
149
The element generates a <dfn dfn>block-level box</dfn> ,
154
150
and participates in a block formatting context.
155
151
Other formatting contexts,
156
152
such as flex formatting contexts,
157
153
may also work with block-level elements. [[!CSS21]]
158
154
159
- If <<display-inside>> is unspecified, it defaults to ''block'' .
160
-
161
- <dt> <dfn>inline-level</dfn>
155
+ <dt> <dfn>inline</dfn>
162
156
<dd>
163
- The element generates an <dfn dfn>inline-level box</dfn> ,
164
- and participates in an inline formatting context. [[!CSS21]]
165
-
166
- If <<display-inside>> is unspecified, it defaults to ''inline'' .
157
+ The element generates an <dfn dfn>inline-level box</dfn> . [[!CSS21]]
167
158
168
159
<dt> <dfn>run-in</dfn>
169
160
<dd>
170
161
The element generates a <a>run-in box</a> .
171
162
Run-in elements act like inlines or blocks,
172
163
depending on the surrounding elements.
173
164
See [[#run-in]] for details.
165
+ </dl>
174
166
167
+ If a <<display-inside>> is specified but <<display-outside>> is omitted,
168
+ <<display-outside>> defaults to ''block'' ,
169
+ except that ''ruby'' defaults to ''inline'' .
170
+
171
+ If a <<display-outside>> is specified but <<display-inside>> is omitted,
172
+ <<display-inside>> defaults to ''flow'' .
173
+
174
+ The <dfn value for=display>list-item</dfn> keyword
175
+ makes the element a <a>list item</a> .
176
+ If <<display-inside>> is unspecified,
177
+ it defaults to ''flow'' .
178
+ If <<display-outside>> is unspecified,
179
+ it defaults to ''block'' .
180
+
181
+ <h3>
182
+ Box Generation</h3>
183
+
184
+
185
+ <dl dfn-type=value dfn-for="display, <display-box> ">
175
186
<dt> <dfn>contents</dfn>
176
187
<dd>
177
188
The element itself does not generate any boxes,
178
189
but its children and pseudo-elements still generate boxes as normal.
179
190
For the purposes of box generation and layout,
180
191
the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.
181
192
182
- Issue: ''display-outside/ contents'' currently only has an effect on box generation and layout.
193
+ Issue: ''contents'' currently only has an effect on box generation and layout.
183
194
Other things that care about the document tree are unaffected, like counter scopes.
184
195
Is this what we want?
185
196
@@ -196,15 +207,8 @@ Controlling Layout Modes: the 'display' property</h2>
196
207
for when it's no longer suppressed.
197
208
</dl>
198
209
199
- Issue: ''run-in'' , ''contents'' , and ''none'' shouldn't be <<display-outside>> ,
200
- they should just be lone values.
201
- They were only in the display-outside property because it was the most appropriate of the two,
202
- but none of them actually use the <<display-inside>> value.
203
-
204
- The <dfn value for=display>list-item</dfn> keyword
205
- makes the element a <a>list item</a> .
206
- If <<display-inside>> is unspecified, ???.
207
- If <<display-outside>> is unspecified, ???.
210
+ <h3>
211
+ Layout-Specific Display Types</h3>
208
212
209
213
The <<display-internal>> keywords are defined as follows:
210
214
@@ -214,7 +218,7 @@ Controlling Layout Modes: the 'display' property</h2>
214
218
The element is an <dfn dfn>internal table element</dfn> ,
215
219
and participates in a table layout context. [[!CSS21]]
216
220
217
- ''display-outside/ table-cell'' and ''display-outside/ table-caption'' are <a>layout-specific leaf types</a> ;
221
+ ''table-cell'' and ''table-caption'' are <a>layout-specific leaf types</a> ;
218
222
the rest are <a>layout-specific internal types</a> .
219
223
220
224
<dt> <dfn>ruby-base</dfn> , <dfn>ruby-text</dfn> , <dfn>ruby-base-container</dfn> , <dfn>ruby-text-container</dfn>
@@ -249,28 +253,31 @@ Controlling Layout Modes: the 'display' property</h2>
249
253
when placed in an incompatible parent,
250
254
as defined by their respective specifications.
251
255
256
+ <h3>
257
+ Legacy Display Values</h3>
258
+
252
259
The <<display-legacy>> keywords are defined as follows:
253
260
254
261
<dl dfn-type=value dfn-for="display, <display-legacy> ">
255
- <dt> <dfn>inline</dfn>
262
+ <dt> <dfn>inline-block </dfn>
256
263
<dd>
257
- Behaves as ''inline-level auto '' .
264
+ Behavas as ''inline flow-root '' .
258
265
259
266
<dt> <dfn>inline-list-item</dfn>
260
267
<dd>
261
- Behaves as ''inline-level auto list-item'' .
268
+ Behaves as ''inline list-item'' .
262
269
263
270
<dt> <dfn>inline-table</dfn>
264
271
<dd>
265
- Behaves as ''inline-level table'' .
272
+ Behaves as ''inline table'' .
266
273
267
274
<dt> <dfn>inline-flex</dfn>
268
275
<dd>
269
- Behaves as ''inline-level flex'' .
276
+ Behaves as ''inline flex'' .
270
277
271
278
<dt> <dfn>inline-grid</dfn>
272
279
<dd>
273
- Behaves as ''inline-level grid'' .
280
+ Behaves as ''inline grid'' .
274
281
</dl>
275
282
276
283
<h3 id='transformations'>
@@ -279,7 +286,7 @@ Automatic Box Type Transformations</h3>
279
286
Some layout effects require <dfn export lt="blockify|blockification">blockification</dfn>
280
287
or <dfn export lt="inlinify|inlinification">inlinification</dfn> of the box type,
281
288
causing the box’s <a>outer display type</a> , if it is not ''none'' or ''contents'' ,
282
- to compute to ''block-level '' or ''inline-level '' (respectively).
289
+ to compute to ''block'' or ''inline'' (respectively).
283
290
284
291
<div class='example'>
285
292
Some examples of this include:
@@ -298,7 +305,7 @@ Automatic Box Type Transformations</h3>
298
305
break up the inline formatting context in which it participates.
299
306
300
307
The root element’s display type is always <a>blockified</a> .
301
- Additionally, a 'display' of ''contents'' computes to ''block-level '' on the root element.
308
+ Additionally, a 'display' of ''contents'' computes to ''block'' on the root element.
302
309
303
310
304
311
<h2 id='box-suppress'>
@@ -419,7 +426,7 @@ Run-In Layout</h2>
419
426
(up to, but not including, the next <a>run-in sequence</a> , if any).
420
427
421
428
<li>
422
- A <a>run-in box</a> with ''display: auto '' <a>inlinifies</a> its contents.
429
+ A <a>run-in box</a> with ''display: flow '' <a>inlinifies</a> its contents.
423
430
</ul>
424
431
425
432
A <dfn>run-in sequence</dfn> is a maximal sequence of consecutive sibling <a>run-in boxes</a>
@@ -504,13 +511,13 @@ Appendix B: Glossary</h2>
504
511
505
512
<dt> <dfn lt="inline|inline box">inline</dfn>
506
513
<dd>
507
- A non-replaced <a>inline-level</a> box whose 'display' is ''auto '' .
514
+ A non-replaced <a>inline-level</a> box whose 'display' is ''flow '' .
508
515
The contents of an inline box participate in the same inline formatting context as the inline box itself.
509
516
510
517
<dt> <dfn lt="atomic inline|atomic inline box">atomic inline</dfn>
511
518
<dd>
512
519
An inline-level box that is replaced or that establishes a new formatting context.
513
- (An inline-level box whose 'display' is not ''auto '' establishes a new formatting context of the specified type.)
520
+ (An inline-level box whose 'display' is not ''flow '' establishes a new formatting context of the specified type.)
514
521
515
522
<dt> <dfn lt="block container|block container box">block container</dfn>
516
523
<dd>
@@ -552,6 +559,8 @@ Appendix B: Glossary</h2>
552
559
553
560
Issue: wordsmith this.
554
561
562
+ <dt> <dfn>block formatting context</dfn>
563
+ <dd>
555
564
Block and inline formatting contexts are defined in CSS 2.1 Section 9.4.
556
565
</dl>
557
566
0 commit comments