Contents
Adding text shadows in CSS
By using the CSS text-shadow
property, you can add a customized shadow to a text:
h1 {
text-shadow: 3px 3px #42bff4;
}
/* Gives a shadow for h1 header */
By combining multiple selectors, you can add the same type of shadow to multiple elements:
CSS text-shadow property syntax
To add a CSS font shadow, you need to define from two to four values:
text-shadow: h-shadow v-shadow blur-radius color;
In the example below, you can see all four values defined. All of them will be explained in detail in the following section:
![DataCamp DataCamp](https://assets.bitdegree.org/online-learning-platforms/storage/media/datacamp-logo-5f96bfc70113e.o.png)
- Easy to use with a learn-by-doing approach
- Offers quality content
- Gamified in-browser coding experience
- The price matches the quality
- Suitable for learners ranging from beginner to advanced
- Free certificates of completion
- Focused on data science skills
- Flexible learning timetable
![Udacity Udacity](https://assets.bitdegree.org/online-learning-platforms/storage/media/udacity-review-logo-small.o.png)
- Simplistic design (no unnecessary information)
- High-quality courses (even the free ones)
- Variety of features
- Nanodegree programs
- Suitable for enterprises
- Paid Certificates of completion
![edX edX](https://assets.bitdegree.org/online-learning-platforms/storage/media/edx-logo-60190648f3a51.o.png?tr=w-200)
- A wide range of learning programs
- University-level courses
- Easy to navigate
- Verified certificates
- Free learning track available
- University-level courses
- Suitable for enterprises
- Verified certificates of completion
Available values
Value | Description | |
---|---|---|
h-shadow | Required | The horizontal CSS text shadow position |
v-shadow | Required | The vertical CSS text shadow position |
blur-radius | Optional | The radius of the blur (0 by default) |
color | Optional | The color of the text shadow |
Notice that vertical and horizontal values can be negative:
Browser support
![Browser image](https://www.bitdegree.org/learn/assets/browsers/chrome-logo.jpg)
Chrome
![Browser image](https://www.bitdegree.org/learn/assets/browsers/edge-logo.jpg)
Edge
![Browser image](https://www.bitdegree.org/learn/assets/browsers/firefox-logo.jpg)
Firefox
![Browser image](https://www.bitdegree.org/learn/assets/browsers/ie-logo.jpg)
IE
![Browser image](https://www.bitdegree.org/learn/assets/browsers/opera-logo.jpg)
Opera
![Browser image](https://www.bitdegree.org/learn/assets/browsers/safari-logo.jpg)
Safari
Mobile browser support
![Browser image](https://www.bitdegree.org/learn/assets/browsers/chrome-logo.jpg)
Chrome
![Browser image](https://www.bitdegree.org/learn/assets/browsers/firefox-logo.jpg)
Firefox
![Browser image](https://www.bitdegree.org/learn/assets/browsers/opera-logo.jpg)
Opera
![Browser image](https://www.bitdegree.org/learn/assets/browsers/safari-logo.jpg)