You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css3-flexbox/Overview.src.html
+11-9Lines changed: 11 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -606,7 +606,7 @@ <h2 id='multiline'>
606
606
607
607
<p>A flexbox can be either single-line or multi-line, depending on the 'flex-flow' property. A <dfn>single-line</dfn> flexbox lays out all of its children in a single line, even if that would cause the flexbox to overflow its bounds. A <dfn>multi-line</dfn> flexbox breaks its <i>flexbox items</i> across multiple lines to avoid overflowing, similar to how text is broken onto a new line when it gets too wide to fit on the existing line. Every line contains at least one <i>flexbox item</i>, unless the flexbox itself is completely empty.</p>
608
608
609
-
<p>When additional lines are created, they are stacked in the flexbox in the <i>cross axis</i>. Each line is completely independent; flexible lengths and the 'flex-pack' and 'flex-align' properties only pay attention to the items on a single line at a time. The size of a line depends on the contents of the lines and the value of the 'flex-align' property. The lines are aligned within a flexbox with the 'flex-line-pack' property.</p>
609
+
<p>When additional lines are created, they are stacked in the flexbox in the <i>cross axis</i>. Each line is completely independent; flexible lengths and the 'flex-pack' and 'flex-align' properties only pay attention to the items on a single line at a time. The <i>main size</i> of a line is the same as the <i>main size</i> of the flexbox's content box. The <i>cross size</i> of a line depends on whether the flexbox is <i>single-line</i> or <i>multi-line</i>: the <i>cross size</i>of the sole line in a <i>single-line</i> flexbox is the same as the <i>cross size</i>of the flexbox's content box, while the <i>cross size</i> of a line in a <i>multi-line</i> flexbox is the minimum size necessary to contain the <i>flexbox items</i> on the line, after aligning them with 'flex-align'. The lines themselves are then aligned within a flexbox with the 'flex-line-pack' property.</p>
610
610
611
611
<divclass=example>
612
612
<p>This example shows four buttons that do not fit horizontally.</p>
@@ -682,7 +682,7 @@ <h3 id='flex-line-pack'>
682
682
<td>before
683
683
<tr>
684
684
<th>Applies to:
685
-
<td>flexboxes
685
+
<td><i>multi-line</i>flexboxes
686
686
<tr>
687
687
<th>Inherited:
688
688
<td>no
@@ -694,22 +694,24 @@ <h3 id='flex-line-pack'>
694
694
<td>visual
695
695
</table>
696
696
697
-
<p>The flex-line-pack property may be used to control the alignment of lines in multi-line flexboxes. The values of this property have the following meanings:</p>
697
+
<p>The 'flex-line-pack' property aligns a flexbox's lines within the flexbox when there is extra space in the <i>cross axis</i>, similar to how 'flex-pack' aligns individual items within the <i>main axis</i>:</p>
<dd>The first line of child boxes is placed along the 'before' edge of the content box (as determined by direction of <i>cross axis</i>), and additional lines are placed afterward with no extra spacing between them.</dd>
701
+
<dd>Lines are packed toward the start of the flexbox. The <i>cross-start</i>edge of the first line in the flexbox is placed flush with the <i>cross-start</i> edge of the flexbox, and each subsequent line is placed flush with the preceding line.</dd>
702
702
703
703
<dt><dfnid='flex-line-pack-end'>end</dfn></dt>
704
-
<dd>Lines of child boxes are placed with no extra spacing between and 'after' edge of the last line is aligned with 'after' edge of the content box.</dd>
704
+
<dd>Lines are packed toward the end of the flexbox. The <i>cross-end</i>edge of the last line is placed flush with the <i>cross-end</i>edge of the flexbox, and each preceding line is placed flush with the subsequent line.</dd>
<dd>Lines of child boxes are placed with no space between them and equal amount of extra space left before first line and after last line.</dd>
708
-
707
+
<dd>Lines are packed toward the center of the flexbox. If the leftover free-space is negative, this value is identical to ''start''. Otherwise, the lines in the flexbox are placed flush with each other and aligned in the center of the flexbox, with equal amounts of empty space between the <i>cross-start</i> content edge of the flexbox and the first line in the flexbox and between the <i>cross-end</i> content edge of the flexbox and the last line in the flexbox.</dd>
<dd>The first line of child boxes is aligned with 'before' edge of containing box. Lines of child boxes are spread with equal amout of empty spaces between each two lines, and so that 'after' edge of last line of child boxes is aligned with 'after' edge of conaining box.</dd>
710
+
<dd>Lines are evenly distributed in the flexbox. If the leftover free-space is negative or there is only a single line in the flexbox, this value is identical to ''start''. Otherwise, the <i>cross-start</i> edge of the first line in the flexbox is placed flush with the <i>cross-start</i> content edge of the flexbox, the <i>cross-end</i>edge of the last line in the flexbox is placed flush with the <i>cross-end</i> content edge of the flexbox, and the remaining lines in the flexbox are distributed so that the empty space between any two adjacent lines is the same.</dd>
711
711
</dl>
712
-
712
+
713
+
<pclass='note'>Note: Only <i>multi-line</i> flexboxes ever have free space in the <i>cross axis</i> for lines to be aligned in, because in a <i>single-line</i> flexbox the sole line automatically stretches to fill the space.</p>
0 commit comments