How the border-radius Shorthand Works
CSS border-radius rounds an element’s corners and is a shorthand for up to eight radii. One to four values set the corners clockwise from the top-left (top-left, top-right, bottom-right, bottom-left), following the same fill rules as margin and padding. A slash splits the value into two groups of four — the horizontal radii before the slash and the vertical radii after — and when a corner’s horizontal and vertical radii differ the arc becomes elliptical rather than circular. The Border Radius Generator lets you set each corner, toggle the elliptical (eight-value) form, and always outputs the shortest correct string.
- Corner order is clockwise from top-left: TL, TR, BR, BL
- 1–4 values expand by CSS fill rules; a slash adds a second (vertical) group
- 8-value form: horizontal radii / vertical radii → elliptical arcs
- Output collapses repeats: 16px 16px 16px 16px → 16px
- Deterministic and pure — the same inputs always yield the same CSS
