CSS Elevation Scale

Three ready-made shadow levels for a consistent design system.

  • elevation
  • design system
  • box-shadow
  • levels
HTML
<div class="elevation-1"></div>
<div class="elevation-2"></div>
<div class="elevation-3"></div>
CSS
.elevation-1 {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.06);
}

.elevation-2 {
  box-shadow: 0 4px 8px -2px rgba(15, 23, 42, 0.12), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
}

.elevation-3 {
  box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.2), 0 6px 12px -6px rgba(15, 23, 42, 0.12);
}

About this CSS Elevation Scale

This CSS Elevation Scale is 11 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses box shadows. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

How to use this elevation scale

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .elevation-1 class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback