5 .container { width:
100px; }
6 .left { float: left; border: solid; }
7 .right { float: right; border: solid; }
8 .clear { clear: both; height:
10px; }
9 .inlineBlock { display: inline-block; width:
60px; height:
20px; background: silver; }
14 Test shrink-to-fit width for floating elements (see
<a href=
"http://www.w3.org/TR/2006/WD-CSS21-20061106/visudet.html#q8">CSS
2.1 10.3.5</a>).
17 Shrink-to-fit width is min(max(
<i>preferred minimum width
</i>,
<i>available width
</i>),
<i>preferred width
</i>).
18 In the following cases (except the
“x
”),
<i>preferred minimum width
</i> < <i>available width
</i> < <i>preferred width
</i>
20 <div class=
"container">
24 <div class=
"clear"></div>
28 <div class=
"clear"></div>
35 <div class=
"clear"></div>
37 <div class=
"inlineBlock"></div>
38 <div class=
"inlineBlock"></div>
40 <div class=
"clear"></div>
42 <div class=
"inlineBlock"></div>
43 <div class=
"inlineBlock"></div>