CSS border-radius Property Explained

What the CSS border-radius property does, with an example.

Published November 4, 2026

border-radius rounds the corners of an element. One value rounds all corners; 50% turns a square into a circle.

How it works

You can set each corner separately (top-left, top-right, bottom-right, bottom-left) or use the elliptical syntax with /.

It also clips backgrounds and borders but not overflowing content unless overflow is hidden.

Values and effects

border-radius: 8px; → soft corners
border-radius: 50%; → circle/ellipse
border-radius: 9999px; → pill shape
border-radius: 8px 0 8px 0; → different corners

Practical examples

Card

.card { border-radius: 12px; }

Avatar

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

Pill button

.pill { border-radius: 9999px; padding: .4rem 1rem; }

Common mistakes

  • Using 50% on non-square elements and getting an ellipse.
  • Expecting children to be clipped without overflow: hidden.
  • Rounding only the container but not the image inside.

Key takeaways

  • border-radius in one line: border-radius rounds the corners of an element.
  • Inspect it live in DevTools → Styles.
  • Test across browsers and screen sizes.

FAQ

Circle from a rectangle?

Make width and height equal, then use 50%.

Is border-radius supported in all browsers?

Yes in all modern browsers; check caniuse.com for edge cases.

More CSS articles