# Zigzag Pattern

> A playful zigzag chevron pattern from four angled gradients.

- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: pattern, zigzag, chevron, linear-gradient, background
- Live preview: https://copy-css.com/snippets/zigzag-pattern
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="zigzag"></div>
```

## CSS

```css
.zigzag {
  --size: 32px;
  --a: #f59e0b;
  --b: #fef3c7;
  background:
    linear-gradient(135deg, var(--a) 25%, transparent 25%) calc(var(--size) / -2) 0,
    linear-gradient(225deg, var(--a) 25%, transparent 25%) calc(var(--size) / -2) 0,
    linear-gradient(315deg, var(--a) 25%, transparent 25%),
    linear-gradient(45deg, var(--a) 25%, transparent 25%);
  background-size: var(--size) var(--size);
  background-color: var(--b);
}
```

## Notes

- This CSS Zigzag Pattern is 12 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients and custom properties.
- Customize with: `--size`, `--a`, `--b`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
