How to add shadow to text using CSS ?
The approach of this article is to add a shadow using text-shadow property in CSS. This property accepts a list of a comma-separated list of shadows to be applied to the text. The default value of the text-shadow property is “none”.
Syntax:
text-shadow: h-shadow v-shadow blur-radius color|none|initial|
Example:
HTML
<!DOCTYPE html> < html > < head > < style > h1 { text-shadow: 4px 4px green; } h2 { text-shadow: 2px 3px blue; } </ style > </ head > < body style = "text-align:center;" > < h1 > w3wiki </ h1 > < h2 > How to apply shadow effects to text using CSS? </ h2 > </ body > </ html > |
Output:
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Contact Us