As I mentioned in my tutorial on creating rounded corners, CSS3 is offering up a lot of awesome new features, like multiple columns, gradients, and of course, border effects. In this tutorial, we'll take a look at another new feature, creating drop shadows on text.
This CSS property is supported by the most recent versions of all popular browsers except Internet Explorer...
To get started with this effect, find or create a CSS rule that you'd like to apply the text shadow to. Probably the best way to make use of this would be to create a class rule specifically for applying this effect. That's what I'm going to do anyway. I've also applied a bit of formatting to my text using a redefined paragraph element.
Next, add the "text-shadow" property to your rule. There are four values that we can apply to the "text-shadow" property. First, add in a color. You can use any color you'd like, although drop shadows are usually fairly dark. If you save your file and check your work in your browser, you'll notice that nothing happens. That's because we have to set some additional properties first.
Directly after the color, let's set three numeric values. The first two values can be positive or negative. The last value must be positive.
The second value controls the vertical position of the shadow. A positive value here will move the shadow downwards, while a negative value moves it upwards.
The third value controls the amount of blur on the shadow. Use a lower value for a sharper shadow, or a higher value for a more blurred shadow. As you can see, I prefer using fairly low values.
And that's all there is to creating Text-shadows in CSS3! Continue your CSS learning journey by checking out the tutorial below: