CSS: Text Shadow

By Xah Lee. Date: . Last updated: .

Interactive Text Shadow Generator

offsets x y:
or offset length and direction



font size

css shadow
CSS text shadow effects


  1. text-shadow: x_offset y_offset color
  2. text-shadow: x_offset y_offset blur_radius color
  3. text-shadow: shadow_spec_1, shadow_spec_2, …

Simple Shadow

div {text-shadow: 3px 3px red;}

Fuzzy Shadow

div {text-shadow: 3px 3px 3px red;}

Multiple Shadows

div {text-shadow: -3px -3px 3px green, 3px 3px 3px red;}

Glow Effect


The trick is to specify no shadow offset, but with big value of fuzziness.

div {
 text-shadow: 0 0 .1em cyan;

Outline Effect


The trick for outline font is to specify shadow for all 8 directions {top, bottom, left, right, top right, top left, bottom right, bottom left} with minimal offset, and with big value of blur radius.

div {
  1px   0px 1px black,
        1px 1px black,
 -1px   0px 1px black,
       -1px 1px black,
  1px   1px 1px black,
 -1px  -1px 1px black,
 -1px   1px 1px black,
  1px  -1px 1px black;
border: solid thin black;
padding: 0.5rem;
border-radius: 1rem;

CSS Basics

  1. Basics
  2. Tag Matching Tutorial
  3. Selector Syntax
  4. Units


  1. Color Syntax
  2. Color Names
  3. Opacity
  4. Linear Gradient
  5. Radial Gradient


  1. font-family
  2. Standard Web Fonts
  3. font-size
  4. Meaning of Font Size
  5. Font Weight
  6. Chinese Font Names

Box Model

  1. Border
  2. Outline
  3. Margin vs Padding
  4. Box Sizing


  1. Layout Tutorial
  2. Display Property
  3. Position: static, relative, fixed, absolute
  4. Pure CSS Table
  5. Tabbed Menu
  6. 3 Columns Page Layout
  7. Multi-Column Layout for Text Flow
  8. Fix Element to Window
  9. Centering
  10. Flowing List
  11. z-index
  12. Text Over Image
  13. Text Flow Around Image
  14. OverFlow, Scrollbar


  1. 2D Transform
  2. Transition
  3. Animation

Line Wrap, Justification

  1. Line Wrap
  2. Text Alignment, Justification
  3. Match first-letter and first-line
  4. β€œ:before”, β€œ:after”
  5. Text Decoration: Underline, Overline, Line-Through
  6. Letter Spacing, Word Spacing

Box Decoration

  1. Box Shadow
  2. Text Shadow
  3. Round Corners
  4. Background Image
  5. Image Rollover


  1. Computed Style
  2. Pseudo Class vs Pseudo Element
  3. Media Query
  4. Variable
  5. calc
  6. Reset
  7. user-select
  8. Data URI Scheme
  9. protocol-relative URL
  10. Default Unit
  11. Declaring Character Set in CSS File
  12. Jargons Explained: Tag, Element, Node, Object, Attribute, Property, Method
  13. Display Table on Small Screen
  14. Fixed Aspect Ratio
  15. Add Icon to Links
  16. Progress Bar Example

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials