Aabestfontgenerator.
THE TYPE NOTEBOOK

How to Add a Text Shadow in CSS

Add a CSS text shadow with offset, blur and color, compare hard and soft edges and proof text against the final background.

Apply text-shadow to the element that contains the words. Start with one small shadow and compare it with plain text against the actual background.

Sources reviewed .

COMPARE REAL FONTS

Try the collection.

Read the selection notes ↓

Enter the same words in each specimen to compare. These are editorial starting points; explore each family for its background and license.

LIVE TYPEFACE SPECIMEN

See your words in Anton.

Real font preview
Loading Anton…
Get font from the official source ↗

This preview uses a real font. Copying ordinary text into another app will not carry this font with it. The PNG keeps the visual appearance.

Explore Anton: history, styles and license ↗

LIVE TYPEFACE SPECIMEN

See your words in Inter.

Real font preview
Loading Inter…
Get font from the official source ↗

This preview uses a real font. Copying ordinary text into another app will not carry this font with it. The PNG keeps the visual appearance.

Explore Inter: history, styles and license ↗

01

Use two offsets followed by a blur and color

W3C’s text-shadow examples show how offsets move the shadow and how blur softens its edge. Try text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.55) on the title. The first two lengths move it horizontally and vertically, and the third is the blur. Keep the text color readable without depending on the shadow for contrast.

02

Compare a hard shadow and a soft edge

Start with the same lettering and background. Use no blur for a sharp offset, then add a small blur and inspect the fine details. A large blur can cloud the gaps between letters. Use Anton and Inter as independent references when comparing a heavy headline and a small label. Proof the smallest intended text as well as the largest title.

03

Choose the effect that matches the real background

On a photograph, test the darkest and lightest crops the title might cross. Consider a solid backing if the text changes contrast across the image. Keep the shadow in the style rule so the words remain editable. For a separate copyable caption, the homepage text styles transform characters rather than carrying a CSS effect.

GOOD QUESTIONS

Your questions, answered.

Is text-shadow the same as box-shadow?

Text-shadow follows the letters. Box-shadow applies to an element’s box.

Can copied text keep the shadow?

Ordinary text copying does not carry the CSS style. Use the stylesheet for the page or export a graphic when the visual effect needs to travel.

Sources & background

Sources supporting this page’s explanations. Practical examples are our editorial suggestions.