The inset() CSS function defines a rectangle at the specified inset distances from each side of the reference box. It is a basic shape function used to define one of the <basic-shape> data types.

Try it


shape-outside: inset(20px 50px 10px 0 round 50px);



When all of the four arguments are supplied they represent the top, right, bottom and left offsets from the reference box inward that define the positions of the edges of the inset rectangle. These arguments follow the syntax of the margin shorthand, that let you set all four insets with one, two or four values.


The optional <border-radius> argument(s) define rounded corners for the inset rectangle using the border-radius shorthand syntax.


Basic inset example

In the example below we have an inset() shape used to pull content over the floated element. Change the offset values to see how the shape changes.


CSS Shapes Module Level 1
# funcdef-basic-shape-inset

Browser compatibility

BCD tables only load in the browser

See also