Border Radius Property

Last updated: 2026-09-13

border-radius Border Radius Property

border-radius rounds the sharp corners of an element, making it one of the most used decorative properties in modern UI design. It accepts length or percentage values, and the larger the value, the more pronounced the rounding. When the radius reaches half the side length or beyond, the corner becomes a semicircle or a full circle.

Category
Initial Value0
InheritedNo
Applies Toall
Animation Typelength
CSS VersionCSS3
StatusStandard

📝 Syntax

border-radius: <length-percentage>{1,4} [ / <length-percentage>{1,4} ];

⚙️ Values

ValueTypeDescription
<length>TypeFixed corner radius
<percentage>TypePercentage relative to the element size

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
border-radius v4 v12 v1 v3.1 v10.5
Supported in all major browsers
Tip: border-radius: 50% combined with equal width and height draws a perfect circle, commonly used for avatar cropping.
Tip: It accepts 1 to 4 values, and the slash syntax sets horizontal and vertical radii separately, e.g. border-radius: 20px / 10px for elliptical corners.

❓ FAQ

QDoes border-radius work on img elements?
AYes. border-radius applies to the element's border-box edge and works on replaced elements like <img> too. Give an image border-radius: 50% with equal width and height for a circular avatar. Note that image content can overflow the rounded corners, so it is common to add overflow: hidden on the container.
QWhat is the percentage in border-radius relative to?
APercentages are resolved against the element's own width and height — the horizontal radius against the width and the vertical radius against the height. So border-radius: 50% makes a perfect circle on a square element but an ellipse on a rectangle. This is the trick behind circular avatars and pill buttons.
QHow do I draw a perfect circle and a pill shape?
ACircle: equal width and height plus border-radius: 50%. Pill: border-radius: 999px — when the value exceeds half the height, the two ends automatically become full semicircles. On a rectangle, 50% gives an ellipse, so for pills use 999px or a large fixed pixel value instead.
QWhat does the slash syntax border-radius: 20px / 10px mean?
AThe left side of the slash is the horizontal radius and the right side is the vertical radius, producing elliptical corners. For example, border-radius: 50% / 25% makes the horizontal arc wider than the vertical one. Without the slash, the two radii are equal. You can also write two slash-separated groups to shape each of the four corners independently.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏