Skip to content

Commit aaade7a

Browse files
committed
[css-sizing-4] Add an example of width:stretch in a float.
1 parent ec2bf70 commit aaade7a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

css-sizing-4/Overview.bs

+19-1
Original file line numberDiff line numberDiff line change
@@ -705,10 +705,28 @@ Stretch-fit Sizing: filling the containing block</h3>
705705
</pre>
706706
</div>
707707

708+
<div class="example">
709+
Similarly, ''width: stretch'' causes the box to fill its container,
710+
being 20px narrower than the width of "some more text"
711+
(due to the 10px margin):
712+
713+
<pre class=html>
714+
&lt;div class="outer">
715+
&lt;div class="inner">text&lt;/div>
716+
&lt;/div>
717+
some more text
718+
</pre>
719+
720+
<pre>
721+
.outer { float: left; margin: 0; }
722+
.inner { width: stretch; margin: 10px; }
723+
</pre>
724+
</div>
725+
708726
<div class="example">
709727
On the other hand,
710728
in this example the container's height is indefinite,
711-
causing a percentage height on the child to [=behave as auto=],
729+
which would cause a percentage height on the child to [=behave as auto=],
712730
so ''height: stretch'' [=behaves as auto=] as well.
713731

714732
<pre>

0 commit comments

Comments
 (0)