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
<imgclass="singleImgExample" src="images/stacked-float-example.png" alt="Stacking two floats with a small shape-outside"/>
258
258
</div>
259
259
260
-
<h2id="basic-shapes-from-svg-syntax">
260
+
<h2id="basic-shape-functions">
261
261
Basic Shapes</h2>
262
262
263
263
The <dfn><basic-shape></dfn> type
@@ -556,6 +556,68 @@ <h2 id="shapes-from-image">
556
556
</div>
557
557
</div>
558
558
559
+
<h2id="shapes-from-box-values">
560
+
Shapes from Box Values</h2>
561
+
562
+
Shapes can be defined by reference to edges in the <ahref="http://www.w3.org/TR/CSS21/box.html#box-dimensions">CSS Box Model</a>. These edges include border-radius curvature. The definitions of the <dfn><<box>></dfn> values are:
563
+
564
+
The <dfn>margin-box</dfn> value defines the shape
565
+
enclosed by the outside margin edge.
566
+
The corner radii of this shape are determined by the corresponding border-radius and margin values. If the ratio of <code>border-radius/margin</code> is 1 or more, then the margin box corner radius is <code>border-radius + margin</code>. If the ratio of <code>border-radius/margin</code> is less than 1, then the margin box corner radius is <code>border-radius + (margin * (1 + (ratio-1)^3))</code>.
567
+
568
+
The <dfn>border-box</dfn> value defines the shape
569
+
enclosed by the outside border edge.
570
+
This shape follows all
571
+
of the normal border radius shaping rules
572
+
for the outside of the border.
573
+
574
+
The <dfn>padding-box</dfn> value defines the shape
575
+
enclosed by the outside padding edge.
576
+
This shape follows all
577
+
of the normal border radius shaping rules
578
+
for the inside of the border.
579
+
580
+
The <dfn>content-box</dfn> value defines the shape
581
+
enclosed by the outside content edge.
582
+
Each corner radius of this box
583
+
is the larger of 0
584
+
or <code>border-radius - border-width - padding</code>.
585
+
586
+
<divclass="example">
587
+
588
+
Given the 100px square below with
589
+
10px padding, border and margins,
590
+
the box values define these shapes:
591
+
592
+
<ul>
593
+
<li>margin-box: the box containing all of the yellow pixels</li>
594
+
<li>border-box: the box containing all of the black pixels</li>
595
+
<li>padding-box: the box containing all of the mauve pixels</li>
596
+
<li>content-box: the box containing all of the blue pixels</li>
0 commit comments