CSS Inverted Border Radius
A card with a round bite taken out of its corner for a floating button, cut with a radial-gradient mask.
Rebranding a bakery
<div class="corner-bite">
<div class="corner-bite-card">
<small>Case study</small>
<h3>Rebranding a bakery</h3>
</div>
<a class="corner-bite-btn" href="#" aria-label="Open case study">↗</a>
</div>
.corner-bite {
--r: 30px;
position: relative;
width: 230px;
font-family: system-ui, sans-serif;
}
.corner-bite-card {
height: 140px;
padding: 18px;
box-sizing: border-box;
border-radius: 20px;
background: linear-gradient(150deg, #facc15, #ea580c);
color: #431407;
-webkit-mask: radial-gradient(calc(var(--r) * 1.5 + 4px) at 100% 0, transparent 98%, #000);
mask: radial-gradient(calc(var(--r) * 1.5 + 4px) at 100% 0, transparent 98%, #000);
}
.corner-bite-card small {
font-size: 12px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.corner-bite-card h3 {
margin: 50px 0 0;
font-size: 19px;
}
.corner-bite-btn {
position: absolute;
top: 4px;
right: 4px;
display: grid;
place-items: center;
width: var(--r);
height: var(--r);
border-radius: 50%;
background: #431407;
color: #fde68a;
font-size: 16px;
font-weight: 700;
text-decoration: none;
transition: transform 0.2s ease;
}
.corner-bite-btn:hover {
transform: rotate(45deg);
}
.corner-bite-btn:focus-visible {
outline: 2px solid #431407;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.corner-bite-btn {
transition: none;
}
}
About this CSS Inverted Border Radius
This CSS Inverted Border Radius is 61 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms, linear gradients and radial gradients. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
- transitions
- transforms
- linear gradients
- radial gradients
- masks
- CSS Grid
- keyboard focus styles
- custom properties
- reduced-motion support
Customize it
Change these custom properties to restyle the inverted border radius without touching the rest of the CSS:
| Property | Default |
|---|---|
--r | 30px |
How to use this inverted border radius
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.corner-biteclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.