CSS Blueprint Background

A blueprint grid in pure CSS: faint minor lines, thin major lines and crosshair marks where they cross, on drafting blue. Set the spacing live and copy it.

#223b8c
#7585b7
20px
6
.bg-blueprint {
  --bg: #223b8c;
  --fg: #7585b7;
  --size: 20px;
  --major: 6;
  background-color: var(--bg);
  background-image:
    linear-gradient(color-mix(in srgb, var(--fg) 70%, transparent) 2px, transparent 2px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 70%, transparent) 2px, transparent 2px),
    linear-gradient(color-mix(in srgb, var(--fg) 35%, transparent) 1.5px, transparent 1.5px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 35%, transparent) 1.5px, transparent 1.5px),
    linear-gradient(transparent calc(var(--size) / 2 + 1px), var(--bg) 0 calc(100% - var(--size) / 2 + 1px), transparent 0),
    linear-gradient(90deg, transparent calc(var(--size) / 2 + 1px), var(--bg) 0 calc(100% - var(--size) / 2 + 1px), transparent 0),
    linear-gradient(var(--fg) 4px, transparent 4px),
    linear-gradient(90deg, var(--fg) 4px, transparent 4px);
  background-size:
    calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
    calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
    var(--size) var(--size),
    var(--size) var(--size),
    calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
    calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
    calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
    calc(var(--size) * var(--major)) calc(var(--size) * var(--major));
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 -1px, -1px 0;
}
<div class="
  [--bg:#223b8c]
  [--fg:#7585b7]
  [--size:20px]
  [--major:6]
  [background-color:var(--bg)]
  [background-image:linear-gradient(color-mix(in_srgb,_var(--fg)_70%,_transparent)_2px,_transparent_2px),_linear-gradient(90deg,_color-mix(in_srgb,_var(--fg)_70%,_transparent)_2px,_transparent_2px),_linear-gradient(color-mix(in_srgb,_var(--fg)_35%,_transparent)_1.5px,_transparent_1.5px),_linear-gradient(90deg,_color-mix(in_srgb,_var(--fg)_35%,_transparent)_1.5px,_transparent_1.5px),_linear-gradient(transparent_calc(var(--size)_/_2_+_1px),_var(--bg)_0_calc(100%_-_var(--size)_/_2_+_1px),_transparent_0),_linear-gradient(90deg,_transparent_calc(var(--size)_/_2_+_1px),_var(--bg)_0_calc(100%_-_var(--size)_/_2_+_1px),_transparent_0),_linear-gradient(var(--fg)_4px,_transparent_4px),_linear-gradient(90deg,_var(--fg)_4px,_transparent_4px)]
  [background-size:calc(var(--size)_*_var(--major))_calc(var(--size)_*_var(--major)),_calc(var(--size)_*_var(--major))_calc(var(--size)_*_var(--major)),_var(--size)_var(--size),_var(--size)_var(--size),_calc(var(--size)_*_var(--major))_calc(var(--size)_*_var(--major)),_calc(var(--size)_*_var(--major))_calc(var(--size)_*_var(--major)),_calc(var(--size)_*_var(--major))_calc(var(--size)_*_var(--major)),_calc(var(--size)_*_var(--major))_calc(var(--size)_*_var(--major))]
  [background-position:0_0,_0_0,_0_0,_0_0,_0_0,_0_0,_0_-1px,_-1px_0]
"></div>
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Blueprint — CSS background</title>
  <style>
    html, body { height: 100%; margin: 0; }
    .bg-blueprint {
      --bg: #223b8c;
      --fg: #7585b7;
      --size: 20px;
      --major: 6;
      background-color: var(--bg);
      background-image:
        linear-gradient(color-mix(in srgb, var(--fg) 70%, transparent) 2px, transparent 2px),
        linear-gradient(90deg, color-mix(in srgb, var(--fg) 70%, transparent) 2px, transparent 2px),
        linear-gradient(color-mix(in srgb, var(--fg) 35%, transparent) 1.5px, transparent 1.5px),
        linear-gradient(90deg, color-mix(in srgb, var(--fg) 35%, transparent) 1.5px, transparent 1.5px),
        linear-gradient(transparent calc(var(--size) / 2 + 1px), var(--bg) 0 calc(100% - var(--size) / 2 + 1px), transparent 0),
        linear-gradient(90deg, transparent calc(var(--size) / 2 + 1px), var(--bg) 0 calc(100% - var(--size) / 2 + 1px), transparent 0),
        linear-gradient(var(--fg) 4px, transparent 4px),
        linear-gradient(90deg, var(--fg) 4px, transparent 4px);
      background-size:
        calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
        calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
        var(--size) var(--size),
        var(--size) var(--size),
        calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
        calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
        calc(var(--size) * var(--major)) calc(var(--size) * var(--major)),
        calc(var(--size) * var(--major)) calc(var(--size) * var(--major));
      background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 -1px, -1px 0;
    }
  </style>
</head>
<body class="bg-blueprint"></body>
</html>

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

Blueprint 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 blueprint pattern works

A blueprint background is a drafting sheet on deep blue: faint guide lines, a stronger main grid and crosshair marks at the main grid points. It takes eight layers.

Every layer is a linear-gradient(). The bottom two draw 4px lines along the main grid. The next two paint --bg over those lines everywhere except half a square on each side of every crossing, which leaves a plus at each one. On top, two layers draw 1.5px guide lines every --size pixels at 35% of the line color, and two more draw the 2px main grid at 70% on a tile --major times larger. Over the solid plus they blend in, so the crosshairs stay clean.

--major is a plain number that sets how many small squares fit in each big one: 6 by default, 5 for a classic engineering sheet, or 4 or 8 to follow a 4px or 8px layout system. All shades come from color-mix() on --fg, so you only pick two colors.

Use this CSS blueprint pattern for technical docs, architecture and hardware product pages, “how it’s built” sections and developer portfolios.