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: css-shapes/Overview.src.html
+18-2Lines changed: 18 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -227,7 +227,7 @@ <h3 id="relation-to-box-model-and-float-behavior">Relation to the box model and
227
227
adding this shape to the left float above
228
228
would result in the same rendering.
229
229
<p>
230
-
<pre><codeclass="html">
230
+
<pre><codeclass="css">
231
231
shape-outside: polygon(0 0, 500% 500%, 0 500%);
232
232
</code></pre>
233
233
</div>
@@ -243,11 +243,27 @@ <h3 id="relation-to-box-model-and-float-behavior">Relation to the box model and
243
243
will be constrained
244
244
by the float's left margin edge.
245
245
<p>
246
-
<pre><codeclass="html">
246
+
<pre><codeclass="css">
247
247
shape-outside: rectangle(0,0,0%,0%);
248
248
</code></pre>
249
249
</div>
250
250
251
+
<divclass="example">
252
+
<p>
253
+
The following styling creates a shape much smaller than the float's content area, and adds a margin-top to the float. In the picture, the shape is rendered in blue, the content area in mauve, and the margin area in yellow. The inline content only wraps around the shape.
254
+
</p>
255
+
<pre><codeclass="html">
256
+
#float-left {
257
+
shape-outside: polygon(0% 50%, 50% 100%, 0 100%);
258
+
float: left;
259
+
width: 100px;
260
+
height: 100px;
261
+
margin-top: 20px;
262
+
}
263
+
</code></pre>
264
+
<imgclass="singleImgExample" src="images/float-margin-example.png" alt="Adding margin-top to a float with a small shape-outside"/>
<p>The float is positioned using the margin box. Inline content will flow through the margins of a float with shape-outside, and if the shape-outside does not fill the content box, inline content will flow through those areas as well. Line lengths are only constrained by the shape and the far margin edge.</p>
0 commit comments