Login:  Password:    
forgot my password
sign up!
Search: 

Text-shadow in CSS 3

In this quick tip I’ll show another property of CSS3, the text-shadow, used to create shadows in the texts.

0 0

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.

Text-shadow

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"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Applying Text-shadow</title>
<style type="text/css">
h1{
	text-shadow: #000 2px 3px 2px;
	}
</style>
</head>
<body>
<h1>text-shadow</h1>
</body>
</html>

With this effect, our example will look like this:

text-shadow

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


Ricardo Arrigoni
Front-end developer and WebEditor of MrBool.com. I work in the web design area for over 4 years. For freelance work visit my portfolio: www.ricardoarrigoni.com.br or if you prefer send me an email.

Add your comment
[Fechar]

Este post é fechado - você precisa ter acesso ao post para incluir um comentário.


no comments have been posted - be the first!
Help us to improve! Give us your feedback:

Give your note to this post: 1 2 3 4 5 6 7 8 9 10
Is this post helpful? Yes No



[Close]
To have full access to this post (or download the associated files) you must have MrBool Credits.

  See the prices for this post in Mr.Bool Credits System below:

Individually – in this case the price for this post is US$ 0,00 (Buy it now)
in this case you will buy only this video by paying the full price with no discount.

Package of 10 credits - in this case the price for this post is US$ 0,00
This subscription is ideal if you want to download few videos. In this plan you will receive a discount of 50% in each video. Subscribe for this package!

Package of 50 credits – in this case the price for this post is US$ 0,00
This subscription is ideal if you want to download several videos. In this plan you will receive a discount of 83% in each video. Subscribe for this package!


> More info about MrBool Credits






mrbool.com
contact us   |   publish your post   |   buy credits

Copyright 2013 - all rights reserved to www.web-03.net