Favorites

Create Inverted Corner Border Radius

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

What is an inverted corner?

We all know how to round the corners of a box with the border-radius property. An inverted corner does the opposite: instead of curving outwards, the corner curves inwards, as if a circle has been bitten out of it. It's also called a concave or scooped corner.

Inverted corners are popular for tickets, coupons, badges and decorative cards. Here's the difference:

Results
Rounded corners
Inverted corners

Can't see the difference? The second box uses the new corner-shape property, which works in Chrome, Edge and other Chromium-based browsers. Firefox and Safari show ordinary rounded corners instead. We'll cover how to handle that later in the post.

The old way, and why it's outdated

When this post was first written, CSS had no way to create an inverted corner. The workaround was to place a white circle over each corner of the box, then use overflow: hidden on the box so only a quarter of each circle showed:

/* The old way: no longer recommended */
.corners {
  position: relative;
  overflow: hidden;
  background: #eee;
}
.arc-top-l {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;  /* must match the page background */
}
/* ...plus three more circles, one for each corner */

It worked, but only as an optical illusion, and it had real drawbacks:

  • The circles had to match the page colour. On a coloured background, a photo or a gradient, the white circles showed up as obvious blobs.
  • It needed extra HTML. Four empty <div> elements, or two plus pseudo-elements, just for decoration.
  • Shadows and borders didn't follow the shape. A box-shadow stayed rectangular, giving the game away.

Modern CSS can now create real inverted corners directly, with a single property.

Meet the corner-shape property

The corner-shape property changes the shape of a corner, while border-radius still controls its size. Together they can create far more than simple rounded corners:

.box {
  border-radius: 20px;
  corner-shape: scoop;
}

Key rule: corner-shape does nothing on its own. The corner must have a border-radius first, because that sets how big the shaped area is.

The corner shapes

ValueWhat it looks like
roundA normal rounded corner. This is the default.
scoopAn inward curve, as if a circle has been cut out. This is the inverted corner.
bevelA straight diagonal cut across the corner
notchA square, step-shaped cut-out
squircleA smooth shape between a square and a circle, like app icons on a phone
squareA sharp corner, ignoring the border-radius

Here's each one, all with the same border-radius: 24px:

Results
round
scoop
bevel
notch
squircle
square

Inverted corners with scoop

Let's rebuild the original example, a text box with inverted corners, using corner-shape. No extra HTML is needed:

<div class="inverted">
  <p>Your content goes here...</p>
</div>
.inverted {
  padding: 20px 28px;
  background: #eff6ff;
  border: 2px solid #1d4ed8;
  border-radius: 16px;
  corner-shape: scoop;
}
Results
Inverted corners are now a single line of CSS. Notice how the border follows the curve into each corner, which the old circle trick could never do.

Unlike the old trick, this is a real shape, not an illusion:

  • Borders follow the curve into each corner.
  • Shadows follow the shape too, so box-shadow curves inwards with it.
  • It works on any background, because nothing is painted over the corners. The page simply shows through.

A ticket with a shadow

Here's a ticket on a coloured background, something that was impossible with the old white-circle method:

.ticket {
  padding: 24px 32px;
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  border-radius: 20px;
  corner-shape: scoop;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.25);
}
Results
Admit oneCSS Conference · Row F, Seat 12

Tip: the size of each scoop comes from border-radius. A bigger radius gives a deeper bite; a smaller one gives a subtle nick in the corner.

Different shapes on each corner

Like border-radius, corner-shape accepts up to four values, in the order top-left, top-right, bottom-right, bottom-left:

.mixed {
  border-radius: 24px;
  corner-shape: scoop round scoop round;
}
Results
scoop round scoop round
bevel scoop
Top corners only

To scoop only some corners, you can also give the others no radius, as in the third example, where border-radius: 24px 24px 0 0 leaves the bottom corners square.

Individual corner properties

There are also longhand properties for setting one corner at a time, which is handy when you only want to change one:

.card {
  border-radius: 20px;
  corner-top-left-shape: scoop;
  corner-bottom-right-shape: bevel;
}

The other corners stay at the default, round.

Fine control with superellipse()

Behind the scenes, every corner shape is a curve called a superellipse, a family of shapes that runs smoothly from a sharp square, through a circle, to a deep inward curve. The superellipse() function lets you pick any point along that range with a single number:

NumberSame asShape
infinitysquareSharp corner
2squircleSmooth, rounded square
1roundNormal rounded corner
0bevelStraight diagonal
-1scoopInward curve
-infinitynotchSquare cut-out

Positive numbers curve outwards, and negative numbers curve inwards. Values in between give shapes the keywords can't, such as a scoop that's softer or sharper than usual:

.soft-scoop  { corner-shape: superellipse(-0.5); }
.sharp-scoop { corner-shape: superellipse(-3); }
Results
superellipse(-0.5)
superellipse(-1)
superellipse(-3)

Tip: corner-shape can be animated, so a corner can morph smoothly from round to scoop on hover with a simple transition.

Supporting every browser

At the time of writing, corner-shape works in Chrome, Edge, Opera and other browsers built on Chromium, but not yet in Firefox or Safari. Check our corner-shape property page for the latest support.

The good news is that unsupported browsers simply ignore the property and fall back to ordinary rounded corners from border-radius. For most designs, that's a perfectly good result. This approach is called progressive enhancement: everyone gets a working design, and newer browsers get an extra flourish.

Changing the fallback with @supports

If rounded corners don't suit the fallback, the @supports rule lets you apply styles only when a browser understands a feature. Here, unsupported browsers get square corners, and supported browsers get scooped ones:

.ticket {
  border-radius: 0;
}

@supports (corner-shape: scoop) {
  .ticket {
    border-radius: 20px;
    corner-shape: scoop;
  }
}

Scooped corners in every browser today

If you need inverted corners in all browsers right now, a CSS mask can do it. A mask uses an image, here made of gradients, to decide which parts of an element are visible. Each radial-gradient covers one quarter of the box and makes a transparent circle at its corner:

.ticket {
  --r: 20px;  /* the size of each scoop */
  mask:
    radial-gradient(circle var(--r) at top left,     #0000 98%, #000) top left,
    radial-gradient(circle var(--r) at top right,    #0000 98%, #000) top right,
    radial-gradient(circle var(--r) at bottom left,  #0000 98%, #000) bottom left,
    radial-gradient(circle var(--r) at bottom right, #0000 98%, #000) bottom right;
  mask-size: 51% 51%;
  mask-repeat: no-repeat;
}
Results
Admit oneWorks in every modern browser
  • #0000 is fully transparent black, the "cut-out" part. #000 is solid, the visible part.
  • 98% instead of 100% softens the edge of the circle slightly, so it isn't jagged.
  • mask-size: 51% 51% makes each gradient cover just over a quarter, so there are no gaps down the middle.

Good to know: a mask cuts away everything outside its shape, including borders and shadows. That's why corner-shape is the better choice where it's supported: it bends borders and shadows to follow the corner instead of cutting them off.

Want to experiment with corner sizes and shapes without writing the code by hand? Try our CSS corner generator, which lets you design corners visually and copy the finished CSS.

Wrapping up

Inverted corners used to need extra HTML and a white-circle illusion that only worked on plain backgrounds. Now border-radius plus corner-shape: scoop creates real inverted corners, with borders and shadows that follow the curve. Use it as a progressive enhancement, add a mask if you need every browser covered today, and explore the other shapes too: bevel, notch and squircle open up a whole new range of designs.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee