# Stacked Layers Button

> A bold outlined button that fans out two colored layers behind it on hover, then snaps flat on click.

- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: offset, depth, playful, retro, box-shadow
- Live preview: https://copy-css.com/snippets/stacked-layers-button
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<button class="btn-stack">Join the club</button>
```

## CSS

```css
.btn-stack {
  padding: 14px 32px;
  border: 2px solid #111827;
  border-radius: 10px;
  background: #fde047;
  color: #111827;
  font: 700 16px/1 system-ui, sans-serif;
  cursor: pointer;
  /* Each layer = a colored shadow inset by 2px over a dark one (the outline) */
  box-shadow:
    0 0 0 -2px #f472b6, 0 0 0 0 #111827,
    0 0 0 -2px #60a5fa, 0 0 0 0 #111827;
  transition: box-shadow 0.2s ease;
}

.btn-stack:hover,
.btn-stack:focus-visible {
  box-shadow:
    5px 5px 0 -2px #f472b6, 5px 5px 0 0 #111827,
    10px 10px 0 -2px #60a5fa, 10px 10px 0 0 #111827;
}

.btn-stack:active {
  box-shadow:
    0 0 0 -2px #f472b6, 0 0 0 0 #111827,
    0 0 0 -2px #60a5fa, 0 0 0 0 #111827;
}

.btn-stack:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 14px;
}
```

## Notes

- This CSS Stacked Layers Button is 32 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
