Skip to content

Commit 50a7edd

Browse files
committed
Switch display:flexbox to display:flex.
--HG-- extra : rebase_source : 93e14ff2edd2ff1bc5eeccc76d5bd55b85fe3b4e
1 parent fe62017 commit 50a7edd

2 files changed

Lines changed: 95 additions & 87 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ <h2 class="no-num no-toc" id=table>Table of contents</h2>
194194
Model</a>
195195

196196
<li><a href="#display-flexbox"><span class=secno>3. </span> Flexboxes: the
197-
&lsquo;<code class=css>flexbox</code>&rsquo; and &lsquo;<code
198-
class=css>inline-flexbox</code>&rsquo; &lsquo;<code
197+
&lsquo;<code class=css>flex</code>&rsquo; and &lsquo;<code
198+
class=css>inline-flex</code>&rsquo; &lsquo;<code
199199
class=property>display</code>&rsquo; values</a>
200200

201201
<li><a href="#flex-items"><span class=secno>4. </span> Flexbox Items</a>
@@ -340,7 +340,7 @@ <h2 id=intro><span class=secno>1. </span> Introduction</h2>
340340
&lt;li>&lt;button>&lt;img src='trash.svg' alt="trash">&lt;/button>&lt;/li>
341341
&lt;/ul>
342342
&lt;style>
343-
ul { display: flexbox; flex-pack: distribute; }
343+
ul { display: flex; flex-pack: distribute; }
344344
/* Irrelevant styling for this example removed. */
345345
&lt;/style></pre>
346346

@@ -376,8 +376,8 @@ <h3 id=values><span class=secno>1.2. </span> Values</h3>
376376

377377
<h2 id=box-model><span class=secno>2. </span> The Flexbox Box Model</h2>
378378

379-
<p>An element with &lsquo;<code class=css>display:flexbox</code>&rsquo; or
380-
&lsquo;<code class=css>display:inline-flexbox</code>&rsquo; is a <dfn
379+
<p>An element with &lsquo;<code class=css>display:flex</code>&rsquo; or
380+
&lsquo;<code class=css>display:inline-flex</code>&rsquo; is a <dfn
381381
id=flexbox>flexbox</dfn>. Children of a flexbox are called <a
382382
href="#flexbox-item"><i>flexbox items</i></a> and are laid out using the
383383
flexbox box model.
@@ -448,10 +448,9 @@ <h2 id=box-model><span class=secno>2. </span> The Flexbox Box Model</h2>
448448
class=property>flex-line-pack</code></a>&rsquo; property.
449449

450450
<h2 id=display-flexbox><span class=secno>3. </span> Flexboxes: the
451-
&lsquo;<a href="#display-flexbox"><code
452-
class=css>flexbox</code></a>&rsquo; and &lsquo;<a
453-
href="#display-inline-flexbox"><code
454-
class=css>inline-flexbox</code></a>&rsquo; &lsquo;<code
451+
&lsquo;<a href="#flex"><code class=css>flex</code></a>&rsquo; and
452+
&lsquo;<a href="#display-inline-flex"><code
453+
class=css>inline-flex</code></a>&rsquo; &lsquo;<code
455454
class=property>display</code>&rsquo; values</h2>
456455

457456
<table class=propdef>
@@ -464,27 +463,26 @@ <h2 id=display-flexbox><span class=secno>3. </span> Flexboxes: the
464463
<tr>
465464
<th><a href="http://dev.w3.org/csswg/css-module/#values">New value</a>:
466465

467-
<td><dfn id=display-flexbox>flexbox</dfn> | <dfn
468-
id=display-inline-flexbox>inline-flexbox</dfn>
466+
<td><dfn id=display-flex>flex</dfn> | <dfn
467+
id=display-inline-flex>inline-flex</dfn>
469468
</table>
470469

471470
<p> An element whose computed &lsquo;<code
472471
class=property>display</code>&rsquo; is either &lsquo;<a
473-
href="#display-flexbox"><code class=css>flexbox</code></a>&rsquo; or
474-
&lsquo;<a href="#display-inline-flexbox"><code
475-
class=css>inline-flexbox</code></a>&rsquo; is a flexbox, and establishes a
476-
new <dfn id=flexbox-formatting-context>flexbox formatting context</dfn>
477-
for its contents. This is similar to a block formatting context root:
478-
floats do not intrude into the flexbox, and the flexbox's margins do not
479-
collapse with the margins of its contents. Additionally, each of the <a
472+
href="#flex"><code class=css>flex</code></a>&rsquo; or &lsquo;<a
473+
href="#display-inline-flex"><code class=css>inline-flex</code></a>&rsquo;
474+
is a flexbox, and establishes a new <dfn
475+
id=flexbox-formatting-context>flexbox formatting context</dfn> for its
476+
contents. This is similar to a block formatting context root: floats do
477+
not intrude into the flexbox, and the flexbox's margins do not collapse
478+
with the margins of its contents. Additionally, each of the <a
480479
href="#flexbox-item"><i>flexbox items</i></a> establishes a new formatting
481480
context for its contents.
482481

483-
<p> The &lsquo;<a href="#display-flexbox"><code
484-
class=css>flexbox</code></a>&rsquo; value makes the flexbox a block-level
485-
element. The &lsquo;<a href="#display-inline-flexbox"><code
486-
class=css>inline-flexbox</code></a>&rsquo; value makes the flexbox an
487-
atomic inline-level element.
482+
<p> The &lsquo;<a href="#flex"><code class=css>flex</code></a>&rsquo; value
483+
makes the flexbox a block-level element. The &lsquo;<a
484+
href="#display-inline-flex"><code class=css>inline-flex</code></a>&rsquo;
485+
value makes the flexbox an atomic inline-level element.
488486

489487
<p> Flexboxes are not block containers, and so some properties that were
490488
designed with the assumption of block layout don't apply in a flexbox
@@ -495,12 +493,13 @@ <h2 id=display-flexbox><span class=secno>3. </span> Flexboxes: the
495493
in the Multicol module have no effect on a flexbox.
496494

497495
<li> &lsquo;<code class=property>float</code>&rsquo; and &lsquo;<code
498-
class=property>clear</code>&rsquo; have no effect on a flexbox item.
499-
Using &lsquo;<code class=property>float</code>&rsquo; on an element still
500-
causes that element's &lsquo;<code class=property>display</code>&rsquo;
501-
property to compute to &lsquo;<code class=css>block</code>&rsquo;, and
502-
thus &lsquo;<code class=property>float</code>&rsquo; may affect whether
503-
an element becomes a flexbox item or is wrapped in one. (See <a
496+
class=property>clear</code>&rsquo; have no effect on a <a
497+
href="#flexbox-item"><i>flexbox item</i></a>. Using &lsquo;<code
498+
class=property>float</code>&rsquo; on an element still causes that
499+
element's &lsquo;<code class=property>display</code>&rsquo; property to
500+
compute to &lsquo;<code class=css>block</code>&rsquo;, and thus
501+
&lsquo;<code class=property>float</code>&rsquo; may affect whether an
502+
element becomes a flexbox item or is wrapped in one. (See <a
504503
href="http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo">CSS 2.1 Chapter
505504
9.7</a>.)
506505

@@ -510,17 +509,15 @@ <h2 id=display-flexbox><span class=secno>3. </span> Flexboxes: the
510509

511510
<p> If an element's specified value for &lsquo;<code
512511
class=property>display</code>&rsquo; is &lsquo;<a
513-
href="#display-inline-flexbox"><code
514-
class=css>inline-flexbox</code></a>&rsquo; and the element is floated or
515-
absolutely positioned, the computed value of &lsquo;<code
516-
class=property>display</code>&rsquo; is &lsquo;<a
517-
href="#display-flexbox"><code class=css>flexbox</code></a>&rsquo;. The
518-
table in <a href="http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo">CSS
519-
2.1 Chapter 9.7</a> is thus amended to contain an additional row, with
520-
&lsquo;<a href="#display-inline-flexbox"><code
521-
class=css>inline-flexbox</code></a>&rsquo; in the "Specified Value" column
522-
and &lsquo;<a href="#display-flexbox"><code
523-
class=css>flexbox</code></a>&rsquo; in the "Computed Value" column.
512+
href="#display-inline-flex"><code class=css>inline-flex</code></a>&rsquo;
513+
and the element is floated or absolutely positioned, the computed value of
514+
&lsquo;<code class=property>display</code>&rsquo; is &lsquo;<a
515+
href="#flex"><code class=css>flex</code></a>&rsquo;. The table in <a
516+
href="http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo">CSS 2.1 Chapter
517+
9.7</a> is thus amended to contain an additional row, with &lsquo;<a
518+
href="#display-inline-flex"><code class=css>inline-flex</code></a>&rsquo;
519+
in the "Specified Value" column and &lsquo;<a href="#flex"><code
520+
class=css>flex</code></a>&rsquo; in the "Computed Value" column.
524521

525522
<p> The baseline of a flexbox is:
526523

@@ -581,7 +578,7 @@ <h2 id=flex-items><span class=secno>4. </span> Flexbox Items</h2>
581578
<p>Examples of flexbox items:
582579

583580
<pre>
584-
&lt;div style="display:flexbox">
581+
&lt;div style="display:flex">
585582

586583
&lt;!-- flexbox item: block-level child -->
587584
&lt;div id="item1">block&lt;/div>
@@ -713,7 +710,7 @@ <h2 id=multi-line><span class=secno>5. </span> Multi-line Flexbox</h2>
713710

714711
<pre>&lt;style>
715712
#div1 {
716-
display: flexbox;
713+
display: flex;
717714
flex-flow: row wrap;
718715
width: 300px;
719716
}
@@ -758,7 +755,7 @@ <h2 id=multi-line><span class=secno>5. </span> Multi-line Flexbox</h2>
758755

759756
<pre>
760757
#div1 {
761-
display: flexbox;
758+
display: flex;
762759
flex-flow: row wrap;
763760
flex-pack: center;
764761
width: 300px;
@@ -1183,7 +1180,7 @@ <h3 id=flex-order><span class=secno>6.4. </span> Display Order: the
11831180

11841181
<pre>
11851182
.tabs {
1186-
display: flexbox;
1183+
display: flex;
11871184
}
11881185
.tabs > .current {
11891186
flex-order: -1; /* Lower than the default of 0 */
@@ -1224,7 +1221,7 @@ <h3 id=flex-order><span class=secno>6.4. </span> Display Order: the
12241221
<p>This layout can be easily achieved with Flexbox:
12251222

12261223
<pre>
1227-
#main { display: flexbox; }
1224+
#main { display: flex; }
12281225
#main > article { flex:1; flex-order: 2; }
12291226
#main > nav { width: 200px; flex-order: 1; }
12301227
#main > aside { width: 200px; flex-order: 3; }</pre>
@@ -1339,8 +1336,8 @@ <h2 id=flexibility><span class=secno>7. </span> Flexibility: the &lsquo;<a
13391336
omitted, the flex basis defaults to &lsquo;<code
13401337
class=css>0px</code>&rsquo;. If the <var>&lt;&apos;width&apos;></var>
13411338
component is &lsquo;<code class=css>auto</code>&rsquo; on a child of a <a
1342-
href="#display-flexbox"><i>flexbox</i></a>, the <a
1343-
href="#flex-basis"><i>flex basis</i></a> is the computed value of the <a
1339+
href="#flexbox"><i>flexbox</i></a>, the <a href="#flex-basis"><i>flex
1340+
basis</i></a> is the computed value of the <a
13441341
href="#main-size-property"><i>main size property</i></a>.
13451342

13461343
<p> If the <var>&lt;&apos;width&apos;></var> is zero, it
@@ -1369,7 +1366,7 @@ <h2 id=flexibility><span class=secno>7. </span> Flexibility: the &lsquo;<a
13691366
<pre>
13701367
&lt;!DOCTYPE html>
13711368
&lt;style>
1372-
div { display:flexbox; outline:1px solid silver; }
1369+
div { display:flex; outline:1px solid silver; }
13731370
p { flex:1 auto; margin:1em; background:gold; }
13741371
&lt;/style&gt;
13751372
&lt;div&gt;
@@ -1433,8 +1430,11 @@ <h3 id=auto-margins><span class=secno>8.1. </span> Aligning with
14331430
simple markup like this
14341431

14351432
<pre>
1436-
div { display:flexbox;
1437-
width:4em; height:4em; background:silver;
1433+
div {
1434+
display: flex;
1435+
width: 4em;
1436+
height: 4em;
1437+
background:silver;
14381438
}
14391439
p { margin:auto; }
14401440
&lt;div&gt;&lt;p&gt;OK&lt;/p&gt;&lt;/div&gt;</pre>
@@ -1445,10 +1445,13 @@ <h3 id=auto-margins><span class=secno>8.1. </span> Aligning with
14451445
<p>And this
14461446

14471447
<pre>
1448-
div { display:flexbox;
1449-
width:calc(100% - 4em); height:calc(100% - 4em);
1450-
border: 1em solid blue; border-radius:50%;
1451-
margin:auto;
1448+
div {
1449+
display: flex;
1450+
width: calc(100% - 4em);
1451+
height:calc(100% - 4em);
1452+
border: 1em solid blue;
1453+
border-radius:50%;
1454+
margin: auto;
14521455
}
14531456
div#demo { width:9em; height:9em; }
14541457

@@ -1806,7 +1809,7 @@ <h3 id=flex-align><span class=secno>8.3. </span> Cross-axis Alignment: the
18061809
&lt;/div>
18071810
&lt;style>
18081811
div {
1809-
display: flexbox;
1812+
display: flex;
18101813
flex-flow: column;
18111814
flex-align: center;
18121815
width: 200px;
@@ -2740,7 +2743,7 @@ <h2 class=no-num id=property>Property index</h2>
27402743
<tr>
27412744
<th><span class=property>display</span>
27422745

2743-
<td>flexbox | inline-flexbox
2746+
<td>flex | inline-flex
27442747

27452748
<tr>
27462749
<th><a class=property href="#flex">flex</a>
@@ -2941,17 +2944,16 @@ <h2 class=no-num id=index>Index</h2>
29412944
title="''end''"><strong>8.4.</strong></a>, <a href="#flex-pack-end"
29422945
title="''end''"><strong>8.2.</strong></a>
29432946

2944-
<li>flex, <a href="#flex" title=flex><strong>7.</strong></a>
2947+
<li>flex, <a href="#display-flex" title=flex><strong>3.</strong></a>, <a
2948+
href="#flex" title=flex><strong>7.</strong></a>
29452949

29462950
<li>flex-align, <a href="#flex-align0"
29472951
title=flex-align><strong>8.3.</strong></a>
29482952

29492953
<li>flex basis, <a href="#flex-basis"
29502954
title="flex basis"><strong>7.</strong></a>
29512955

2952-
<li>flexbox, <a href="#display-flexbox"
2953-
title=flexbox><strong>3.</strong></a>, <a href="#flexbox"
2954-
title=flexbox><strong>2.</strong></a>
2956+
<li>flexbox, <a href="#flexbox" title=flexbox><strong>2.</strong></a>
29552957

29562958
<li>flexbox formatting context, <a href="#flexbox-formatting-context"
29572959
title="flexbox formatting context"><strong>3.</strong></a>
@@ -3002,8 +3004,8 @@ <h2 class=no-num id=index>Index</h2>
30023004
<li>indefinite, <a href="#definite"
30033005
title=indefinite><strong>9.</strong></a>
30043006

3005-
<li>inline-flexbox, <a href="#display-inline-flexbox"
3006-
title=inline-flexbox><strong>3.</strong></a>
3007+
<li>inline-flex, <a href="#display-inline-flex"
3008+
title=inline-flex><strong>3.</strong></a>
30073009

30083010
<li>&lsquo;<code class=css>justify</code>&rsquo;, <a
30093011
href="#flex-line-pack-justify"

0 commit comments

Comments
 (0)