Every box a browser draws starts with four sharp corners, and it shows. The usual fix is a border-radius value copied from an old project and pasted wherever a corner looks too hard, with mixed results: too round on a small button, barely there on a wide card, and quietly wrong on anything that is not the size the value was borrowed from.
This guide explains how border-radius actually works: one setting per corner, percentages that scale with the element, and the slash syntax that separates horizontal rounding from vertical. It uses the free Border Radius Generator on Ovatly, which shapes the corners with per-corner sliders against a full-size live preview, then produces the declaration to copy into your stylesheet.
Contents
- Quick answer
- What border-radius actually does
- Why the generator works in percentages
- Simple mode, Fancy mode and the slash
- How to make rounded corners, step by step
- Worked example: the classic blob
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
To make rounded corners with CSS border-radius: set one radius per corner, in clockwise order from the top left, and apply the declaration. In the Border Radius Generator, move the four corner sliders, check the full-size preview, and copy the border-radius declaration it writes for you. The generator works in percentages, so the horizontal radii are percentages of the element's width and the vertical radii percentages of its height, and one declaration adapts to any size of element. For a perfect circle, set every radius to 50 percent on a square element.
What border-radius actually does
A corner is not rounded by a single number. Each corner of an element is shaped by two radii: a horizontal one, which sets how far the curve reaches along the top or bottom edge, and a vertical one, which sets how far it reaches along the side. Together they trace a quarter of an ellipse. Give a corner equal horizontal and vertical radii and the curve is part of a circle; make them differ and the corner stretches into an ellipse, gentle in one direction and tight in the other.
The declaration lists the corners in a fixed order: top left, top right, bottom right, bottom left, clockwise from the top left. When a declaration carries a slash, the values before it are the horizontal radii in that order, and the values after it are the vertical radii in the same order. Most simple rounding never needs the slash, because the vertical radii quietly match the horizontal ones.
Why the generator works in percentages
A percentage radius is relative: a horizontal radius of 20 percent means 20 percent of the element's width, whatever that width turns out to be. The same declaration rounds a thumbnail and a hero panel by the same proportion, which is why percentage shapes survive responsive layouts that would break a fixed pixel value borrowed from a different design.
The tradeoff is that the same values change character with the element's shape. On a square, equal percentages describe a circle. On a wide, short rectangle, the horizontal radii are percentages of a long width and the vertical radii percentages of a short height, so each corner follows an ellipse. Nothing is malfunctioning: the declaration is doing exactly what it says, relative to two different dimensions.
Simple mode, Fancy mode and the slash
In simple mode you set four sliders, one per corner, and those are the horizontal radii. The vertical radii follow them, and because the two sets match, the generator writes the short form of the declaration with no slash. That covers the great majority of interface rounding: cards, buttons, inputs, images.
Fancy mode adds four more sliders for the vertical radii, set independently of the horizontal ones. That independence is what produces the organic blob shapes used for avatars, hero images and decorative panels, where no corner is a neat quarter-circle. The output then carries the slash, with the horizontal set before it and the vertical set after it, both in the clockwise order.
How to make rounded corners, step by step
- Open the Border Radius Generator and move the four corner sliders to set the horizontal radii. Work in the clockwise order: top left, top right, bottom right, bottom left.
- For a blob shape, switch on Fancy mode and set the four vertical radii as well. Leave Fancy mode off for ordinary rounding.
- Check the preview shape at full size. This is where overlapping corners and ellipse effects show up, before anything reaches your stylesheet.
- Copy the border-radius declaration and paste it into the element's CSS rule.
Worked example: the classic blob
Set the horizontal radii to 30, 70, 70 and 30 percent, in the clockwise order, then switch on Fancy mode and set the vertical radii to 30, 30, 70 and 70 percent. The generator produces:
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
Read it as two sets of corners. Before the slash, the horizontal reach of the top left, top right, bottom right and bottom left corners. After the slash, the vertical reach of the same four corners in the same order. Because the two sets differ, the corners are ellipses of different proportions, and the element becomes the soft, uneven blob that avatar frames and hero panels use.
For the opposite extreme, set all eight radii to 50 percent on a square element and the blob tightens into a perfect circle.
Limitations and honest tradeoffs
The generator works in percentages only. That is a deliberate choice in favour of shapes that scale, but if your design system specifies fixed pixel rounding, the declaration is a starting point rather than the final value: take a corner value from the output, replace the percent sign with px, and tune from there in your stylesheet.
Percentages also mean the result is never fully separable from the element it lands on. The identical declaration gives a circle on a square, an ellipse-cornered panel on a rectangle, and a different feel again on a tall, narrow box. And if you push the values until opposite corners would overlap, the browser scales all the radii down proportionally to keep the shape valid. The preview shows that scaled shape accurately, so what you copy is what you get, but the numbers you set are not always the numbers that render.
Common mistakes
- Reading the values in the wrong order. The order is clockwise from the top left. Read it any other way and the rounded corner lands on the wrong side.
- Chasing a circle on a rectangle. Fifty percent everywhere gives a circle only on a square element. On a rectangle it gives an ellipse, every time.
- Setting radii that overlap and blaming the preview. Oversized corners are scaled down proportionally by the browser. The preview already shows the scaled result; trust it over the slider numbers.
- Reaching for Fancy mode by default. If your vertical radii equal your horizontal ones, the short form does the same job with a shorter declaration.
- Copying one declaration onto every element. Percentage values travel well, but a radius that suits a wide card can swallow a small button. Check each size class in the preview.
FAQs
How do I make a perfect circle? Set all eight radii to 50 percent, or all four in simple mode, on a square element. On a rectangle the same values produce an ellipse, because horizontal percentages refer to the width and vertical percentages to the height.
What order do the four values go in? Top left, top right, bottom right, bottom left: clockwise from the top left. The same order applies on both sides of the slash, horizontal values first, then vertical.
Why does my shape change when the element is not square? Percentage radii are relative to each dimension. On a rectangle, the horizontal radii are percentages of a longer width and the vertical radii percentages of a shorter height, so the corners follow an ellipse rather than a circle. That is usually what blob designs want.
What happens if my corners overlap? Extreme combinations can make opposite corners overlap. Browsers scale the radii down proportionally so the shape still renders, and the generator's preview shows that scaled result accurately before you copy anything.
Can I get pixel values instead of percentages? The generator works in percentages so shapes scale responsively. For fixed pixel rounding, take a single corner value from the output and replace the percent sign with px as a starting point, then tune the result in your stylesheet.
Conclusion
Rounded corners stop being guesswork once you know the three moving parts: one radius per corner in clockwise order, percentages that tie the curve to the element's own dimensions, and a slash that lets the vertical radii go their own way when a shape needs it. The Border Radius Generator keeps all three visible at once, so the declaration you copy is the shape you already approved in the preview. For the words that sit inside those rounded panels, our guide to counting the words on a web page shows how to get a count you can defend. For more guides in this series, see our Website and Webmaster Tools guides.
References
- MDN Web Docs, the border-radius property reference: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
- W3C, CSS Backgrounds and Borders Module Level 3, on corner shapes: https://www.w3.org/TR/css-backgrounds-3/#border-radius