Online Tool Store Online Tool Store
🎨 Design & Color

· 3 min read

How to Build CSS Border Radius Shapes

Manesh Jayawardhana

CIO & Co-founder

Manesh Jayawardhana is the CIO and Co-Founder of Ceyentra Technologies, where he has spent over nine years leading the design and delivery of software solutions for clients across the globe, spanning web, mobile, AI, and capital market systems. He has grown Online Tool Store's engineering team from the ground up while steering the company's technical direction. His writing draws on this breadth of experience building and shipping software across a wide range of industries and markets. View on LinkedIn

Share

How to Build CSS Border Radius Shapes

Rounded corners look simple until the shape needs to be precise. A pill, card, blob-like panel, or asymmetric image crop may require more than border-radius: 8px. CSS supports eight radius values and elliptical slash syntax, but writing that shorthand by hand is easy to get wrong.

A CSS border radius generator helps you shape corners visually, generate the shortest valid CSS, and understand when the browser scales radii because they do not fit the box.

What border radius design involves

Each corner can have a horizontal and vertical radius. In simple cases, one value rounds all corners equally. In advanced cases, CSS can define different horizontal and vertical radii with slash syntax, such as border-radius: 20px 40px / 10px 30px.

Percentages behave differently from pixels because they depend on the element size. A 50% radius can create a circle or pill shape when the dimensions support it.

Why people get stuck here

The shorthand order is not obvious once you move beyond one or two values. Top-left, top-right, bottom-right, and bottom-left values must be placed correctly, and slash syntax doubles the mental load.

Another surprise is scaling. If the combined radii along a side exceed the element size, browsers reduce them according to the CSS specification. That can make the rendered shape differ from the numbers you typed.

Radius FeatureUse Case
One valueSame rounding everywhere
Four valuesDifferent corner sizes
Slash syntaxElliptical corners
PercentagesResponsive pill or oval shapes

What good radius CSS looks like

The preview matches the real box

Resize the preview when percentages are involved so you can see how the shape responds.

The shorthand is readable

Use the shortest CSS that still expresses the intended shape.

Scaling warnings are visible

If the browser will shrink radii, knowing the scaling factor prevents confusion.

Common mistakes to avoid

  • Mixing corner order. CSS order starts top-left, then top-right, bottom-right, bottom-left.
  • Assuming percentages equal pixels. Percent values respond to element dimensions.
  • Ignoring slash syntax. Elliptical radii need horizontal and vertical values.
  • Overbuilding simple shapes. A pill may only need a large single radius.

How to do it with CSS Border Radius Generator

  1. Open the free CSS Border Radius Generator.
  2. Adjust each corner in the live preview.
  3. Use elliptical controls when horizontal and vertical curves should differ.
  4. Resize the preview if percentages are part of the design.
  5. Copy the generated border-radius CSS.

The tool also reports when radii overflow and the browser scales them down.

Frequently asked questions

What does the slash mean in border-radius?

The slash separates horizontal radii from vertical radii, enabling elliptical corners.

How do I make a pill shape?

Use a very large radius, often 9999px, or a percentage-based value on a rounded rectangle.

Why does my radius look smaller than expected?

If combined radii exceed the side length, the browser scales them to fit.

Final thought

Border radius is more powerful than most people use. A visual generator makes the full syntax easier to trust.

Try the free CSS Border Radius Generator

#css-border-radius-generator#border-radius-css#rounded-corners-css#elliptical-border-radius#online-tools#free-tools