R
Rajesh Patra

CSS Background Patterns

Beautiful pure CSS background patterns — customize colors, opacity & spacing, then copy CSS, Tailwind or download PNG.

Full Preview
Polka Dots

Colors

Settings

0.50
28px
1.5px

Fade Effect

Export PNG
CSS Output
background-color: #0f172a;
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'28'%20height%3D'28'%3E%3Ccircle%20cx%3D'14'%20cy%3D'14'%20r%3D'3.36'%20fill%3D'rgba(99%2C102%2C241%2C0.5)'%2F%3E%3C%2Fsvg%3E");
background-size: 28px 28px;

Presets

Patterns

How to use these patterns?

See it live on CodePen
1

Pick & customize

Select a pattern from the grid, then adjust the background color, pattern color, opacity, spacing, and stroke width using the controls on the left.

2

Copy the CSS

Click Copy CSS to get the three-property snippet, or Tailwind for an inline React style object. Paste it directly into your project.

3

Apply it in your code

The easiest way is a fixed full-screen <div> inside your <body> — see the snippet below.

Plain HTML / CSS

HTML

<!-- In your HTML -->
<div class="bg-pattern"></div>

CSS

.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  /* ← paste the copied CSS here */
  background-color: #0f172a;
  background-image: url("data:image/svg+xml,...");
  background-size: 28px 28px;
}

React / Next.js (Tailwind inline)

// In your layout.tsx or page.tsx
export default function Layout({ children }) {
  return (
    <>
      {/* ← paste the copied Tailwind style here */}
      <div
        className="fixed inset-0 -z-10"
        style={{
          backgroundColor: '#0f172a',
          backgroundImage: `url("data:...")`,
          backgroundSize: '28px 28px',
        }}
      />
      {children}
    </>
  );
}

💡 Tip: Use Preview to see the pattern as a full-page background before copying. Use Export PNG to download at any size — from 512 × 512 tiles up to 4K (3840 × 2160) — or enter a custom width & height for use in Figma, Photoshop, or as a wallpaper.