The circle()
value for shape-outside
can accept two possible arguments. The first is the shape-radius
.
Both circle()
and ellipse()
values for shape-outside
are specified as accepting this argument of <shape-radius>
. This argument can be a length or percentage but can also be one of the keywords closest-side
or farthest-side
.
The keyword closest-side
uses the length from the center of the shape to the closest side of the reference box. For circles, this is the closest side in any dimension. For ellipses, this is the closest side in the radius dimension.
The keyword farthest-side
uses the length from the center of the shape to the farthest side of the reference box. For circles, this is the farthest side in any dimension. For ellipses, this is the farthest side in the radius dimension.
The second argument is a position
. If omitted this will be set to center
. However you can use any valid position here to indicate the position of the center of the circle.
Our circle therefore accepts one radius value, which may be a length, a percentage or the closest-side or farthest side keyword then optionally the keyword at followed by a position value.
In the below example I have created a circle on an item with a width of 100 pixels, plus a margin of 20 pixels. This gives a total width for the reference box of 140 pixels. I have given a value of 50% for the shape-radius value which means that our radius is 70px. I have then set the position value to 30%.
In the live example you can play with increasing or decreasing the size of the circle by changing the size of the radius, moving the circle around with the position value, or setting a reference box as we did for inset()
.
As an additional example, if you use the keywords top left
for position, you can make a quarter circle shape in the top left corner of the page. The example below uses generated content to create a quarter circle shape for text to flow around.