CSS text-shadow Property
Description
The text-shadow property applies one or more shadow effects to the glyphs of text, creating the illusion of depth, glow, blur, or outline around letters. Shadows are painted relative to each glyph so they follow the shape of the characters (including inner contours of letters like “o” or “e”), and multiple shadows can be layered to produce complex visual treatments. Because the effect is applied to the text itself rather than the box that contains it, it’s especially useful when you need the shadow to conform tightly to letter shapes rather than to the element’s rectangle.
Designers use text-shadow for a wide variety of typographic enhancements: subtle drop shadows to improve legibility against textured backgrounds, soft glows for neon-like effects, inset or embossed looks to suggest surface depth, and faux outlines by stacking shadows. When choosing shadow color and contrast with the text you’ll often coordinate it with the element’s foreground color—see color—and with overall layout so the shadow reads correctly at the text’s size and weight. It also pairs visually with box-level effects such as box-shadow when both the text and its container need complementary depth cues.
Keep in mind practical and accessibility considerations: heavy, blurred, or multi-layered shadows can reduce legibility—especially at small sizes or for users with visual impairments—so use them sparingly or increase contrast and sizing when needed. Shadows interact with how type is rendered, so results can vary with different fonts and with properties such as font-size; display and decorative fonts tolerate more extreme treatments than fine text. Also consider performance and responsiveness: many costly shadow effects or animated shadow changes can increase rendering work on the GPU, so test on target devices and simplify effects where smoothness matters.
Finally, because text-shadow is a purely decorative property, it’s often combined thoughtfully with typographic and layout choices rather than relied on for meaning. Use it to support hierarchy and emphasis, not to convey essential information by itself. When designing for different backgrounds or themes, you may prefer subtler shadowing or none at all and rely on contrast and spacing (typographic choices) to maintain clarity.
Definition
- Initial value
- none
- Applies to
- All elements
- Inherited
- Yes
- Computed value
- A color plus three absolute lengths
- Animatable
- Yes
- JavaScript syntax
- object.style.textShadow
Interactive Demo
Syntax
text-shadow: none | <length>{2,3} && <color>
Values
- noneNo shadow is applied.
- <length>This is a <length> value. The first value represents offset-x and the second value represents offset-y, these values are required. The third value represents the blur radius, the higher the value, the bigger the blur; the shadow becomes wider and lighter. If not specified, it defaults to 0.
- <color>Optional. Can be specified either before or after the offset values. If the color is not specified, a browser chosen color will be used.
Example
Browser Support
The following information will show you the current browser support for the CSS text-shadow property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
