What Is CSS text-shadow?
The CSS text-shadow property adds shadows to text. One shadow can lift a headline off the page or make text readable over a busy photo, and several stacked together can create dramatic effects like neon signs, 3D lettering, outlines and fire, all with live, selectable, SEO-friendly text instead of an image. Text shadows are used in hero headings, logos, gaming and event sites, posters, thumbnails and dark-mode highlights.
This text shadow generator lets you build any effect visually. Tweak each layer, see it instantly on your own text and font, and copy clean CSS.
How to Use the Text Shadow Generator
- Type your preview text and choose the font, size, weight and colours.
- Try a preset such as Neon, 3D, Outline, Retro or Fire.
- Fine-tune each layer: horizontal and vertical offsets, blur, colour and opacity.
- Add layers to build up complex effects, or delete the ones you don't need.
- Copy the CSS and paste it into your stylesheet.
text-shadow Syntax
text-shadow: offset-x offset-y blur-radius color;
| Value | Meaning | Example |
|---|---|---|
| offset-x | Horizontal shift (negative = left) | 2px |
| offset-y | Vertical shift (negative = up) | 2px |
| blur-radius | Softness (0 = hard edge), optional | 4px |
| color | Any CSS colour, often with transparency | rgba(0,0,0,0.45) |
Unlike box-shadow, text-shadow has no spread value and no inset. Separate multiple shadows with commas; the first is drawn on top.
How the Popular Effects Work
- Neon glow: several shadows with zero offset and increasing blur (4, 10, 20, 40px) in a bright colour, with white or pale text, on a dark background.
- 3D text: a stack of hard shadows, each 1px further down and right in a darker shade of the text colour, plus one soft shadow at the end for depth.
- Outline / stroke: eight hard shadows offset in every direction around the letters. (For crisp outlines,
-webkit-text-strokeis an alternative.) - Long shadow: 20 or more hard shadows stepping diagonally, giving the popular flat-design long shadow.
- Emboss / letterpress: a light shadow above-left and a dark one below-right, on text close to the background colour.
- Fire: blurred yellow-to-red shadows with negative vertical offsets that rise above the letters.
Readability and Accessibility
A subtle shadow (e.g. 0 1px 3px rgba(0,0,0,.5)) is a great way to keep white text readable over photos and videos. Decorative effects, on the other hand, can reduce legibility, especially neon and heavy blur on body text. Keep heavy effects for large display headings, keep the base text colour contrasting with the background (check it with the Color Contrast Checker), and don't rely on a shadow alone to meet contrast requirements.
Performance Tips
Text shadows with many layers or large blur radii are more expensive to render, especially when animated or on long passages of text. Use them on headings rather than paragraphs, avoid animating text-shadow on large blocks, and test on mobile devices.
Text Shadows for Readability Over Images
Hero banners and video thumbnails often place white text over busy photos. A soft, dark shadow such as 0 2px 8px rgba(0, 0, 0, 0.6) separates the letters from the background without looking like an effect. Combine it with a subtle gradient overlay for the most reliable readability, and test the result on both light and dark areas of the image. For long captions, a semi-transparent background panel behind the text is usually easier to read than any shadow.
Combining text-shadow with Other Effects
- Gradient text + shadow: gradient text uses a transparent colour, so use
filter: drop-shadow()instead of text-shadow. - Animated glow: animate the shadow's opacity or blur on hover for interactive neon buttons, and respect
prefers-reduced-motion. - Stroke + shadow: pair
-webkit-text-strokewith a hard offset shadow for bold comic-book headings.
Frequently Asked Questions
Can I use text-shadow on emoji and icons?
Yes. Emoji and icon fonts are text, so text-shadow applies to them. For SVG icons, use filter: drop-shadow() instead.
How do I make a neon text effect in CSS?
Use white text on a dark background with stacked glows: text-shadow: 0 0 4px #fff, 0 0 10px #f0d, 0 0 20px #f0d, 0 0 40px #f0d.
Can text-shadow have a spread?
No. Only box-shadow has spread. Simulate a thicker glow by stacking several shadows.
How do I outline text with CSS?
Use -webkit-text-stroke: 2px #000 (widely supported), or the 8-shadow outline preset here.
Does text-shadow work in all browsers?
Yes, in every browser, with multiple shadows supported.
How do I remove a text shadow?
Set text-shadow: none.