# Inverted Border Radius

> A card with a round bite taken out of its corner for a floating button, cut with a radial-gradient mask.

- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: inverted radius, cutout, notch, mask, radial-gradient, card corner
- Live preview: https://copy-css.com/snippets/inverted-border-radius
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<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>
```

## CSS

```css
.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;
  }
}
```

## Notes

- 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.
- Customize with: `--r`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
