effects

border-radius

Rounds the corners of an element's border box. Values can be lengths or percentages, and the slash syntax lets you set different horizontal and vertical radii for elliptical corners.

border-radius: <length> | <percentage> | <t> <tr> <br> <bl> [/ <t> <tr> <br> <bl>]

Common values

Value Effect
0 Sharp square corners
4px Subtle rounded UI corners
12px Common card radius
9999px Pill or capsule shape
50% Perfect circle on square elements

Examples

.card { border-radius: 12px; }

Modern rounded card

.avatar { width: 40px; height: 40px; border-radius: 50%; }

Circular avatar

.pill { border-radius: 9999px; padding: .25rem .75rem; }

Capsule badge

Gotcha

Rounding does not clip child content; use overflow: hidden on the parent to actually clip children to the rounded shape.

Related properties

← All CSS properties · CSS selectors · Grid vs Flexbox