# Four Corner Gradient

> A smooth four-color gradient with a different color in each corner, blended with a masked layer.

- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: mesh, bilinear, mask, pastel, background
- Live preview: https://copy-css.com/snippets/four-corner-gradient
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="gradient-corners"></div>
```

## CSS

```css
/* Bottom row of colors on the element, top row on a layer that fades out downward */
.gradient-corners {
  position: relative;
  isolation: isolate;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
}

.gradient-corners::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #fde047, #f472b6);
  -webkit-mask: linear-gradient(#000, #0000);
  mask: linear-gradient(#000, #0000);
}
```

## Notes

- This CSS Four Corner Gradient is 16 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients and masks.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
