All Articles Web
How To Create Text Shadows in CSS3
Geoff Blake on Wed, March 30th 0 comments
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 t

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...

Step 1

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.

Step 2

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.

Step 3

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.


Now what are these values for? Well, the first value is for the horizontal position of the drop shadow. A positive value will move the shadow to the right, and a negative value moves it to the left.

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:

Comments (0)

You must be logged in to comment.

Feedback
Course Advisor
Don't Know Where To Start?
Ask A Course Advisor
Ask Us!
Copy the link below and paste it into an email, forum, or Facebook to share this with your friends.
Make money when you share our links
Become a macProVideo.com Affiliate!
The current affiliate rate is: 50%
Classes Start Next Week!
Live 8-week Online Certification Classes for: