# One-Sided Shadows

> Box shadows on just one edge (top, right, bottom or left) using a negative spread value.

- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: bottom only, negative spread, top, side, box-shadow
- Live preview: https://copy-css.com/snippets/one-sided-shadows
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="side-shadow-top">Top</div>
<div class="side-shadow-right">Right</div>
<div class="side-shadow-bottom">Bottom</div>
<div class="side-shadow-left">Left</div>
```

## CSS

```css
/* The negative spread (-6px) hides the shadow on the other three sides */
.side-shadow-top,
.side-shadow-right,
.side-shadow-bottom,
.side-shadow-left {
  display: grid;
  place-items: center;
  width: 96px;
  height: 64px;
  border-radius: 12px;
  background: #ffffff;
  color: #475569;
  font: 600 13px system-ui, sans-serif;
}

.side-shadow-top {
  box-shadow: 0 -8px 10px -6px #0f172a59;
}

.side-shadow-right {
  box-shadow: 8px 0 10px -6px #0f172a59;
}

.side-shadow-bottom {
  box-shadow: 0 8px 10px -6px #0f172a59;
}

.side-shadow-left {
  box-shadow: -8px 0 10px -6px #0f172a59;
}
```

## Notes

- This CSS One-Sided Shadows is 30 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
