CSS Shadows Reference

Compare CSS box shadows, text shadows, and drop shadows and choose the effect that matches the rendered shape.

CSS Shadows Reference

Compare CSS box shadows, text shadows, and drop shadows and choose the effect that matches the rendered shape.

Updated 2026-08-07

Choose a shadow type

FeatureApplies toSpreadInsetFollows alpha shape
box-shadowElement border boxYesYesNo
text-shadowText glyphs and decorationsNoNoYes
filter: drop-shadow()Rendered image or element alphaNoNoYes

Examples

  • Tool.io

    Soft elevation

    A positive vertical offset and broad blur create a conventional elevated card.

    CSS box-shadow: 0 8px 24px rgb(15 23 42 / 16%);
  • Tool.io

    Hard shadow

    A zero blur radius produces a crisp, graphic offset shadow.

    CSS box-shadow: 6px 6px 0 rebeccapurple;
  • Tool.io

    Layered elevation

    Layer a tight contact shadow with a larger ambient shadow for more natural depth.

    CSS box-shadow: 0 1px 2px rgb(0 0 0 / 12%), 0 12px 32px rgb(0 0 0 / 18%);
  • Tool.io

    Inset shadow

    The inset keyword paints inside the border box to create a recessed surface.

    CSS box-shadow: inset 0 3px 8px rgb(15 23 42 / 35%);
  • Tool.io

    Inner glow

    A centered inset shadow with a bright color creates an inner glow.

    CSS box-shadow: inset 0 0 18px rgb(59 130 246 / 55%);
  • Tool.io

    Spread ring

    A zero-offset shadow with spread can supplement an accessible outline or focus indicator.

    CSS box-shadow: 0 0 0 4px rgb(59 130 246 / 45%);
  • Tool.io

    Colored shadow

    Colored shadows can echo a component accent while retaining visible depth.

    CSS box-shadow: 0 12px 24px rgb(102 51 153 / 45%);
  • Tool.io

    Outer glow

    Zero offsets, a large blur, and positive spread radiate evenly around the element.

    CSS box-shadow: 0 0 24px 6px rgb(236 72 153 / 55%);
  • Readable text

    Text shadow

    Text shadow follows glyph shapes; keep it restrained so letterforms remain legible.

    CSS text-shadow: 0 2px 4px rgb(0 0 0 / 45%);
  • Layered text

    Layered text shadow

    Multiple comma-separated text shadows are painted front to back.

    CSS text-shadow: 1px 1px #ec4899, 2px 2px #8b5cf6, 3px 3px #2563eb;
  • Alpha-aware drop shadow

    drop-shadow() follows the rendered alpha silhouette instead of the rectangular border box.

    CSS filter: drop-shadow(0 10px 8px rgb(0 0 0 / 35%));
  • Layered drop shadows

    Multiple drop-shadow() filter functions can build layered shadows around a silhouette.

    CSS filter: drop-shadow(4px 4px 0 #ec4899) drop-shadow(4px 4px 0 #2563eb);
CSS shadow types

Use box-shadow for a rectangular component frame, text-shadow for glyphs, and drop-shadow() when a transparent image or irregular rendered shape should cast the shadow.

Usability and performance

Description

Compare CSS box shadows, text shadows, and drop shadows and choose the effect that matches the rendered shape.

References

  1. CSS Backgrounds and Borders Module Level 3: Drop Shadows
  2. CSS Text Decoration Module Level 4: Text Shadows
  3. Filter Effects Module Level 1: drop-shadow()

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies