Skip to content

Commit 2ef7ab6

Browse files
committed
Clarify the cross-sizing of a flexbox with one line. Editorial tweaking of the 'flex lines' chapter.
1 parent 3f93102 commit 2ef7ab6

2 files changed

Lines changed: 74 additions & 54 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ <h2 class="no-num no-toc" id=table>Table of contents</h2>
233233
property</a>
234234
</ul>
235235

236-
<li><a href="#multi-line"><span class=secno>6. </span> Multi-line Flex
237-
Containers</a>
236+
<li><a href="#flex-lines"><span class=secno>6. </span> Flex Lines</a>
238237

239238
<li><a href="#flexibility"><span class=secno>7. </span> Flexibility</a>
240239
<ul class=toc>
@@ -368,9 +367,9 @@ <h2 id=intro><span class=secno>1. </span> Introduction</h2>
368367
right, down, or even up!), can have their order swapped around dynamically
369368
(i.e., display order is independent of source order), and can "flex" their
370369
sizes and positions to respond to the available space. If a flex container
371-
is <a href="#multi-line0"><i>multi-line</i></a>, the flex items flow in
372-
two dimensions, wrapping into separate lines in a fashion similar to how
373-
text is wrapped into multiple lines.
370+
is <a href="#multi-line"><i>multi-line</i></a>, the flex items flow in two
371+
dimensions, wrapping into separate lines in a fashion similar to how text
372+
is wrapped into multiple lines.
374373

375374
<div class=example>
376375
<p>For example, the following HTML snippet uses a flex container to create
@@ -488,7 +487,7 @@ <h2 id=box-model><span class=secno>2. </span> Flex Layout Box Model</h2>
488487
href="#flex-item"><i>flex items</i></a> can either "stretch" to fill the
489488
available space or be aligned within the space with the ‘<a
490489
href="#flex-align"><code class=property>flex-align</code></a>’ property.
491-
If a flex container is <a href="#multi-line0"><i>multi-line</i></a>, new
490+
If a flex container is <a href="#multi-line"><i>multi-line</i></a>, new
492491
lines are added in the <a href="#cross-end"><i>cross-end</i></a>
493492
direction, and can similarly be aligned, centered, or distributed within
494493
the flex container with the ‘<a href="#flex-line-pack"><code
@@ -735,7 +734,7 @@ <h3 id=visibility-collapse><span class=secno>4.2. </span> Effects of
735734
that helps keep the flex container's layout stable. If a flex container
736735
has only one line (whether it's <a
737736
href="#single-line"><i>single-line</i></a> or <a
738-
href="#multi-line0"><i>multi-line</i></a>), dynamically collapsing or
737+
href="#multi-line"><i>multi-line</i></a>), dynamically collapsing or
739738
uncollapsing items is guaranteed to have no effect on the flex container's
740739
<a href="#cross-size"><i>cross size</i></a>, so it won't cause the rest of
741740
your page's layout to "wobble". (A flex container with multiple lines may
@@ -987,7 +986,7 @@ <h3 id=flex-wrap-property><span class=secno>5.2. </span> Flex Line
987986
<p> The ‘<a href="#flex-wrap"><code
988987
class=property>flex-wrap</code></a>’ property controls whether the flex
989988
container is <a href="#single-line"><i>single-line</i></a> or <a
990-
href="#multi-line0"><i>multi-line</i></a>, and the direction of the
989+
href="#multi-line"><i>multi-line</i></a>, and the direction of the
991990
<i>cross-axis</i>, which determines the direction new lines are stacked
992991
in.
993992

@@ -1008,7 +1007,7 @@ <h3 id=flex-wrap-property><span class=secno>5.2. </span> Flex Line
10081007

10091008
<dt><dfn id=flex-flow-wrap><code class=css>wrap</code></dfn>
10101009

1011-
<dd> The flex container is <a href="#multi-line0"><i>multi-line</i></a>.
1010+
<dd> The flex container is <a href="#multi-line"><i>multi-line</i></a>.
10121011
The <a href="#cross-start"><i>cross-start</i></a> direction is equivalent
10131012
to either the <a
10141013
href="http://www.w3.org/TR/css3-writing-modes/#start">start</a> or <a
@@ -1274,39 +1273,50 @@ <h3 id=flex-order-property><span class=secno>5.4. </span> Display Order:
12741273
intelligent wrapping left as an exercise for the reader.)</small>
12751274
</div>
12761275

1277-
<h2 id=multi-line><span class=secno>6. </span> Multi-line Flex Containers</h2>
1276+
<h2 id=flex-lines><span class=secno>6. </span> Flex Lines</h2>
12781277

12791278
<p> A flex container can be either <a
12801279
href="#single-line"><i>single-line</i></a> or <a
1281-
href="#multi-line0"><i>multi-line</i></a>, depending on the ‘<a
1282-
href="#flex-wrap"><code class=property>flex-wrap</code></a>’ property. A
1283-
<dfn id=single-line>single-line</dfn> flex container lays out all of its
1284-
children in a single line, even if that would cause its contents to
1285-
overflow. A <dfn id=multi-line0>multi-line</dfn> flex container breaks its
1286-
<a href="#flex-item"><i>flex items</i></a> across multiple lines to avoid
1287-
overflowing, similar to how text is broken onto a new line when it gets
1288-
too wide to fit on the existing line. Every line contains at least one <a
1289-
href="#flex-item"><i>flex item</i></a>, unless the flex container itself
1290-
is completely empty.
1291-
1292-
<p> When additional lines are created, they are stacked in the flex
1293-
container along the <a href="#cross-axis"><i>cross axis</i></a>. Once
1294-
content is broken into lines, each line is laid out independently;
1280+
href="#multi-line"><i>multi-line</i></a>, depending on the ‘<a
1281+
href="#flex-wrap"><code class=property>flex-wrap</code></a>’ property:
1282+
1283+
<ul>
1284+
<li> A <dfn id=single-line>single-line</dfn> flex container lays out all
1285+
of its children in a single line, even if that would cause its contents
1286+
to overflow.
1287+
1288+
<li> A <dfn id=multi-line>multi-line</dfn> flex container breaks its <a
1289+
href="#flex-item"><i>flex items</i></a> across multiple lines to avoid
1290+
overflowing, similar to how text is broken onto a new line when it gets
1291+
too wide to fit on the existing line. When additional lines are created,
1292+
they are stacked in the flex container along the <a
1293+
href="#cross-axis"><i>cross axis</i></a> according to the ‘<a
1294+
href="#flex-wrap"><code class=property>flex-wrap</code></a>’ property.
1295+
Every line contains at least one <a href="#flex-item"><i>flex
1296+
item</i></a>, unless the flex container itself is completely empty.
1297+
</ul>
1298+
1299+
<p> Once content is broken into lines, each line is laid out independently;
12951300
flexible lengths and the ‘<a href="#flex-pack"><code
12961301
class=property>flex-pack</code></a>’ and ‘<a
12971302
href="#flex-item-align"><code class=property>flex-item-align</code></a>
12981303
properties only consider the items on a single line at a time.
12991304

1300-
<p> The <a href="#main-size"><i>main size</i></a> of a line is the same as
1301-
the <a href="#main-size"><i>main size</i></a> of the flex container's
1302-
content box. the <a href="#cross-size"><i>cross size</i></a> of a line is
1303-
the minimum size necessary to contain the <a href="#flex-item"><i>flex
1304-
items</i></a> on the line, after aligment due to ‘<a
1305-
href="#flex-item-align"><code
1306-
class=property>flex-item-align</code></a>’. The lines themselves are
1307-
then aligned within the flex container with the ‘<a
1308-
href="#flex-line-pack"><code class=property>flex-line-pack</code></a>
1309-
property.
1305+
<p> When a flex container has multiple lines, the <a
1306+
href="#cross-size"><i>cross size</i></a> of each line is the minimum size
1307+
necessary to contain the <a href="#flex-item"><i>flex items</i></a> on the
1308+
line (after aligment due to ‘<a href="#flex-item-align"><code
1309+
class=property>flex-item-align</code></a>’), and the lines are aligned
1310+
within the flex container with the ‘<a href="#flex-line-pack"><code
1311+
class=property>flex-line-pack</code></a>’ property. When a flex
1312+
container (even a <a href="#multi-line"><i>multi-line</i></a> one) has
1313+
only one line, the <a href="#cross-size"><i>cross size</i></a> of the line
1314+
is the <a href="#cross-size"><i>cross size</i></a> of the flex container,
1315+
and ‘<a href="#flex-line-pack"><code
1316+
class=property>flex-line-pack</code></a>’ has no effect. The <a
1317+
href="#main-size"><i>main size</i></a> of a line is always the same as the
1318+
<a href="#main-size"><i>main size</i></a> of the flex container's content
1319+
box.
13101320

13111321
<div class=example>
13121322
<p> This example shows four buttons that do not fit horizontally.
@@ -2224,7 +2234,7 @@ <h3 id=flex-line-pack-property><span class=secno>8.4. </span> The ‘<a
22242234
<tr>
22252235
<th>Applies to:
22262236

2227-
<td><a href="#multi-line0"><i>multi-line</i></a> flex containers
2237+
<td><a href="#multi-line"><i>multi-line</i></a> flex containers
22282238

22292239
<tr>
22302240
<th>Inherited:
@@ -2542,8 +2552,8 @@ <h3 id=cross-sizing><span class=secno>9.4. </span> Cross size determination</h3>
25422552
<li id=algo-cross-line> <strong>Calculate the cross size of each flex
25432553
line.</strong>
25442554
<p> If the flex container has only a single line (even if it's a <a
2545-
href="#multi-line0"><i>multi-line</i></a> flex container), the cross
2546-
size of the flex line is the flex container's inner cross size.
2555+
href="#multi-line"><i>multi-line</i></a> flex container), the cross size
2556+
of the flex line is the flex container's inner cross size.
25472557

25482558
<p> Otherwise, for each flex line:
25492559

@@ -2800,7 +2810,7 @@ <h2 id=pagination><span class=secno>10. </span> Fragmenting Flex Layout</h2>
28002810
page, and some of its flex items don't fit in the remaining space on the
28012811
page, the entire fragment is moved to the next page.
28022812

2803-
<li> When a <a href="#multi-line0"><i>multi-line</i></a> colum flex
2813+
<li> When a <a href="#multi-line"><i>multi-line</i></a> colum flex
28042814
container breaks, each fragment has its own "stack" of flex lines, just
28052815
like each fragment of a multi-column element has its own row of column
28062816
boxes.
@@ -3617,7 +3627,7 @@ <h2 class=no-num id=index>Index</h2>
36173627
<li>min-width/height:auto, <a href="#min-auto"
36183628
title="min-width/height:auto"><strong>4.3.</strong></a>
36193629

3620-
<li>multi-line, <a href="#multi-line0"
3630+
<li>multi-line, <a href="#multi-line"
36213631
title=multi-line><strong>6.</strong></a>
36223632

36233633
<li>negative flex ratio, <a href="#negative-flex-ratio"

css3-flexbox/Overview.src.html

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -790,31 +790,41 @@ <h3 id='flex-order-property'>
790790

791791

792792

793-
<h2 id='multi-line'>
794-
Multi-line Flex Containers</h2>
793+
<h2 id='flex-lines'>
794+
Flex Lines</h2>
795795

796796
<p>
797797
A flex container can be either <i>single-line</i> or <i>multi-line</i>,
798-
depending on the 'flex-wrap' property.
799-
A <dfn>single-line</dfn> flex container lays out all of its children in a single line,
800-
even if that would cause its contents to overflow.
801-
A <dfn>multi-line</dfn> flex container breaks its <i>flex items</i> across multiple lines to avoid overflowing,
802-
similar to how text is broken onto a new line when it gets too wide to fit on the existing line.
803-
Every line contains at least one <i>flex item</i>,
804-
unless the flex container itself is completely empty.
798+
depending on the 'flex-wrap' property:
799+
<ul>
800+
<li>
801+
A <dfn>single-line</dfn> flex container lays out all of its children in a single line,
802+
even if that would cause its contents to overflow.
803+
804+
<li>
805+
A <dfn>multi-line</dfn> flex container breaks its <i>flex items</i> across multiple lines to avoid overflowing,
806+
similar to how text is broken onto a new line when it gets too wide to fit on the existing line.
807+
When additional lines are created,
808+
they are stacked in the flex container along the <i>cross axis</i>
809+
according to the 'flex-wrap' property.
810+
Every line contains at least one <i>flex item</i>,
811+
unless the flex container itself is completely empty.
812+
</ul>
805813

806814
<p>
807-
When additional lines are created,
808-
they are stacked in the flex container along the <i>cross axis</i>.
809815
Once content is broken into lines,
810816
each line is laid out independently;
811817
flexible lengths and the 'flex-pack' and 'flex-item-align' properties only consider the items on a single line at a time.
812818

813819
<p>
814-
The <i>main size</i> of a line is the same as the <i>main size</i> of the flex container's content box.
815-
the <i>cross size</i> of a line is the minimum size necessary to contain the <i>flex items</i> on the line,
816-
after aligment due to 'flex-item-align'.
817-
The lines themselves are then aligned within the flex container with the 'flex-line-pack' property.
820+
When a flex container has multiple lines, the <i>cross size</i> of each line
821+
is the minimum size necessary to contain the <i>flex items</i> on the line
822+
(after aligment due to 'flex-item-align'),
823+
and the lines are aligned within the flex container with the 'flex-line-pack' property.
824+
When a flex container (even a <i>multi-line</i> one) has only one line,
825+
the <i>cross size</i> of the line is the <i>cross size</i> of the flex container,
826+
and 'flex-line-pack' has no effect.
827+
The <i>main size</i> of a line is always the same as the <i>main size</i> of the flex container's content box.
818828

819829
<div class=example>
820830
<p>

0 commit comments

Comments
 (0)