Skip to main content

CSS Shadow Effects

Shadow effects are something CSS can create for you!


CSS Text Shadow

To put a shadow on text, use the CSS text-shadow property.

The horizontal and vertical shadow are all you need to set at minimum. A shadow color and a blur effect are optional extras.

Basic text shadow

Only a horizontal and a vertical shadow here, with neither color nor blur.

Prompt
Show an h1 heading with the text "Text shadow effect!" that has a horizontal shadow of 2px and a vertical shadow of 2px, with no color or blur specified.
Output: complete HTML page

Text shadow with color

The same shadow, now colored red.

Prompt
Show an h1 heading with the text "Text shadow effect!" that has a 2px horizontal shadow, 2px vertical shadow, and a red color.
Output: complete HTML page

Text shadow with blur

The shadow keeps its color and gains a blur effect.

Prompt
Show an h1 heading with the text "Text shadow effect!" that has a 2px horizontal shadow, 2px vertical shadow, 5px blur effect, and red color.
Output: complete HTML page

White text with black shadow

A black shadow sits behind white text.

Prompt
Show an h1 heading with the text "Text shadow effect!" in white color with a text-shadow of 2px 2px 4px #000000. Use a dark or contrasting background so the white text is visible.
Output: complete HTML page

Red neon glow

The shadow here creates a red neon glow.

Prompt
Show an h1 heading with the text "Text shadow effect!" that has a red neon glow effect using text-shadow: 0 0 3px #ff0000.
Output: complete HTML page

Multiple Shadows

One text can carry several shadows: just list them, separated by commas.

Red and blue neon glow

Two shadows combine into a red and blue neon glow.

Prompt
Show an h1 heading with the text "Text shadow effect!" that has two text shadows: a red glow (0 0 3px #ff0000) and a blue glow (0 0 5px #0000ff).
Output: complete HTML page

White text with multiple shadows

Black, blue, and darkblue shadows sit behind white text.

Prompt
Show an h1 heading with the text "Text shadow effect!" in white color with three text shadows: 1px 1px 2px black, 0 0 25px blue, and 0 0 5px darkblue.
Output: complete HTML page

Border around text

With no actual shadows in sight, text-shadow can also draw a plain border around text.

Prompt
Show an h1 heading with the text "Border around text!" in coral color, with text-shadow used to create a plain black border effect: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black.
Output: complete HTML page