CSS text-shadow Property
The text-shadow property adds one or more shadows behind text characters. Multiple shadows are separated by commas and stack in order — first listed appears on top.
Syntax
text-shadow: offset-x offset-y blur-radius color;offset-x— horizontal shift (positive = right, negative = left)offset-y— vertical shift (positive = down, negative = up)blur-radius— softness of the shadow (0 = hard edge)color— any CSS color includingrgba()for transparency
Common Effects
- Glowing text — zero offset, large blur, bright color
- Engraved text — white shadow above, dark shadow below
- Neon effect — multiple overlapping glows with increasing blur
- Hard drop shadow — small offset, zero blur, dark color
Can I add multiple text shadows?
Yes — separate each shadow with a comma: text-shadow: 1px 1px 2px red, 0 0 10px blue;. There is no limit to the number of layers. Multiple shadows are commonly used for neon glow and fire effects.
Does text-shadow affect layout?
No — text shadows are purely decorative and do not affect the element's box model or push surrounding content. They are painted outside the normal flow, similar to box-shadow.
Is text-shadow accessible?
Text shadows have no accessibility impact on screen readers. However, excessive blur or low-contrast shadows can reduce readability for users with low vision — ensure sufficient contrast between the text color and its shadow.