CSS Vertical Stripes Background

Vertical stripes in pure CSS from one repeating-linear-gradient turned 90deg. Set stripe width and gap live for bold bands or pinstripes, then copy the code.

#167364
#6da89e
6px
18px
.bg-vertical-stripes {
  --bg: #167364;
  --fg: #6da89e;
  --size: 6px;
  --gap: 18px;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(90deg, var(--fg) 0 var(--size), transparent 0 calc(var(--size) + var(--gap)));
}
<div class="
  [--bg:#167364]
  [--fg:#6da89e]
  [--size:6px]
  [--gap:18px]
  [background-color:var(--bg)]
  [background-image:repeating-linear-gradient(90deg,_var(--fg)_0_var(--size),_transparent_0_calc(var(--size)_+_var(--gap)))]
"></div>
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Vertical Stripes — CSS background</title>
  <style>
    html, body { height: 100%; margin: 0; }
    .bg-vertical-stripes {
      --bg: #167364;
      --fg: #6da89e;
      --size: 6px;
      --gap: 18px;
      background-color: var(--bg);
      background-image: repeating-linear-gradient(90deg, var(--fg) 0 var(--size), transparent 0 calc(var(--size) + var(--gap)));
    }
  </style>
</head>
<body class="bg-vertical-stripes"></body>
</html>

Save the pattern as an image, with your current colors and settings.

Vertical Stripes in other colors

Click a color to try it in the preview above, then copy the code.

Browse by color: Red · Orange · Yellow · Green · Teal · Blue · Purple · Pink

How the vertical stripes pattern works

Vertical stripes use the same repeating-linear-gradient() as horizontal ones, turned 90deg so the gradient runs left to right and each band stands upright.

One repeat is a stripe plus a gap: --fg for --size pixels, then transparent until --size + --gap, so --bg shows between the stripes. The transparent 0 stop starts exactly where the stripe ends, which keeps the edges sharp. The gradient repeats on its own, so there is no tile to line up and no seam.

--size and --gap are independent. Wide stripes with an equal gap give bold cabana stripes. A --size of 1–2px with a 10–20px --gap gives classic pinstripes, the fine lines you see on suits and old-fashioned stationery.

Use vertical stripes for sidebars, retro and nautical themes, product cards, and subtle textured headers. The Tailwind tab outputs the same stripes as arbitrary-property classes for Tailwind v4.