In this article I'll show you how to work with text-shadows in CSS 3.
This is a very simple feature that was incorporated into the css 3, and it is very good to add it in the text.
The text-shadow property is responsible for adding a shadow to text through the CSS3. As we can see in Listing 1, the statement is very simple. In our example we will give a black shadow to a <h1> in gray.
Let's create an HTML document and add a <h1>. In this <h1> will be applied the text-shadow effect:
Listing 1 : Applying Text-shadow
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
text-shadow: #000 2px 3px 2px;
With this effect, our example will look like this:
In our example, #000 is the shadow color, the first value (2px) is the horizontal distance of the shadow relative to the element, the second value (3px) is the vertical distance of the shadow relative to the element and, the third value (2px ) is the radius of the shadow (blur effect).
As in any other statement in CSS, we can use any unit of measure to define the distance and radius of the shadow, not just pixels, allowing the developers choose your needs.
See you in the next article
Ricardo Arrigoni - Front-end Developer and SEO Analyst