Property border-radius

A shorthand property for the four
border-*-radius properties

This property is a shorthand for the following CSS properties:

The radius applies to the whole background, even if the element has no border; the exact position of the clipping is defined by the background-clip property.

The border-radius property does not apply to table elements when border-collapse is collapse.

Syntax

/* The syntax of the first radius allows one to four values / / Radius is set for all 4 sides */ border-radius: 10px;

/* top-left-and-bottom-right | top-right-and-bottom-left */ border-radius: 10px 5%;

/* top-left | top-right-and-bottom-left | bottom-right */ border-radius: 2px 4px 2px;

/* top-left | top-right | bottom-right | bottom-left */ border-radius: 1px 0 3px 4px;

/* The syntax of the second radius allows one to four values / / (first radius values) / radius */ border-radius: 10px / 20px;

/* (first radius values) / top-left-and-bottom-right | top-right-and-bottom-left */ border-radius: 10px 5% / 20px 30px;

/* (first radius values) / top-left | top-right-and-bottom-left | bottom-right */ border-radius: 10px 5px 2em / 20px 25px 30%;

/* (first radius values) / top-left | top-right | bottom-right | bottom-left */ border-radius: 10px 5% / 20px 25em 30px 35em;

/* Global values */ border-radius: inherit; border-radius: initial; border-radius: revert; border-radius: revert-layer; border-radius: unset;

Values

Denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using length values. Negative values are invalid. Denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using percentage values. Percentages for the horizontal axis refer to the width of the box; percentages for the vertical axis refer to the height of the box. Negative values are invalid.

Example

border-radius: 1em/5em;

/* It is equivalent to: */ border-top-left-radius: 1em 5em; border-top-right-radius: 1em 5em; border-bottom-right-radius: 1em 5em; border-bottom-left-radius: 1em 5em;

border-radius: 4px 3px 6px / 2px 4px;

/* It is equivalent to: */ border-top-left-radius: 4px 2px; border-top-right-radius: 3px 4px; border-bottom-right-radius: 6px 2px; border-bottom-left-radius: 3px 4px;