The text-shadow property introduces a shadow effect to text.
In its basic application, you specify solely the horizontal shadow (2px) and the vertical shadow (2px):
Examples
h1 { text-shadow: 2px 2px; } |
Now, incorporate a (red) color into the shadow.
Examples
h1 { text-shadow: 2px 2px red; } |
Next, apply a blur effect (5px) to the shadow.
Example
h1 { |
Example 1
Applying text-shadow to white text.
h1 { |
Example 2
Creating a red neon glow effect using text-shadow.
h1 { text-shadow: 0 0 3px #ff0000; } |
Example 3
Creating a neon glow effect with red and blue using text-shadow.
h1 { text-shadow: 0 0 3px #ff0000, 0 0 5px #0000ff; } |
Example 4
h1 { color: white; text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue; } |
Tip: Visit our CSS Fonts chapter to learn how to change fonts, text size, and text style. Tip: Visit our CSS Text Effects chapter to explore various text effects. |
|
Property |
Description |
text-shadow |
Specifies the shadow effect applied to text. |