Skip to content

Commit cc2acff

Browse files
committed
Added some text about stretchable margins.
1 parent 1bde3e0 commit cc2acff

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

css3-box/Overview.src.html

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,11 +1505,34 @@ <h3>The margin properties</h3>
15051505
<div class=issue>
15061506
<p>Add a stretch value to allow vertical distribution of blocks in a
15071507
fixed-height containing block? css3-flexbox currently (May 2012)
1508-
proposes to use ''auto'', but in normal flow we need something else,
1509-
because ''auto'' already means ''0'' there.
1508+
proposes to use ''auto'', but in normal flow we probably need
1509+
something else, because ''auto'' already means ''0'' there.
15101510

1511-
<pre class=prod><var>&lt;stretch&gt;</var> = fill( [ <var>&lt;length&gt;</var> | <var>&lt;percentage&gt;</var> ] )</pre>
1511+
<pre class=prod><dfn>&lt;stretch&gt;</dfn> = fill( [ <var>&lt;length&gt;</var> | <var>&lt;percentage&gt;</var> ] )</pre>
1512+
1513+
<p>This sets an elastic margin with a minimum thickness. Maybe it is
1514+
enough without the minimum thickness, i.e.:
1515+
1516+
<pre class=prod><var>&lt;stretch&gt;</var> = fill</pre>
1517+
1518+
<p>Collapsing margins of which at least one has a
1519+
<var>&lt;stretch&gt;</var> value would yield 'fill(<var>M</var> -
1520+
<var>N</var>), or maybe just 'fill'.
1521+
1522+
<p>To find the size of such a collapsed margin, find the nearest
1523+
enclosing containing block in the same flow that has a fixed height,
1524+
call that height <var>H1</var>. Compute the height of the content in
1525+
that containing block (while treating 'fill(<var>P</var>)' as if it
1526+
was simply <var>P</var>) and call that height <var>H2</var>. Count the
1527+
number <var>N</var> of stretchable margins. If <var>H2</var> &lt;
1528+
<var>H1</var>, then increase all the stretchable margins by
1529+
(<var>H1</var> - <var>H2</var>)/<var>N</var>. If there is no such
1530+
enclosing block, 'fill(<var>P</var>)' simply means <var>P</var>.
1531+
1532+
<p>In a multi-column element, each column box is a separate containing
1533+
block for the purpose of stretching the margins.
15121534
</div>
1535+
15131536
<p>These properties set the thickness of the <em>margin area</em>. The value
15141537
may be negative.
15151538

0 commit comments

Comments
 (0)