answersLogoWhite

0


Best Answer

Text-shadow is a useful property that is implemented in most modern browsers. To use text-shadow in your CSS style sheets, there are four things you have to set when writing the declaration, how far to the right (or left) the shadow is from the actual text, how far below (or above) the shadow is from the text, how much blur the shadow should have, and finally what color the shadow should have. The first two declarations can be positive or negative; positive numbers cause the shadow to move to the right and below the text, while negative numbers cause the shadow to move to the left and above the text. Here's an example of how to use a text-shadow on an anchor when the user hovers over the anchor:

a:hover {

text-color: #FFFFFF;

background-color: #0198E1;

text-shadow: 2px 2px 2px #FFCC00;

}

When a user hovers over an anchor link the text color will turn white, the background will become a topaz blue, and will have a gold shadow around the text. You can declare multiple shadows on the same element if you want to have a cooler looking text-shadow. Here is an example:

.cooltextshadow {

text-shadow: 0 0 4px white, 0 -5px 4px #ff3, 2px -10px 6px #fd3, -2px -15px 11px #f80, 2px -25px 18px #f20;

}

This text-shadow declaration has 6 drop shadows declared each one offset from the previous one to make a really cool effect. Notice the negative numbers. This effect is mainly above the text and looks like the text is superheated or on fire.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

Box-shadow is similar to text-shadow, however box-shadow puts a shadow around the whole element, not just the text (which is what text-shadow does). The usage is almost the same, with the addition of one additional declaration property. The first two values determine the offset of the shadow, the third determines the blur radius, and the fourth value determines the spread radius. The last value is the shadow color. Right now Firefox and Webkit both require specific prefixes to make this work right now. To accomodate that, you declare the prefixed declarations first, then declare the standard box-shadow rule. Here's an example how you would use the box-shadow property:

#exampleboxshadow {

-moz-box-shadow: -5px -5px 5px 5px #888;

-webkit-box-shadow: -5px -5px 5px 5px#888;

box-shadow: -5px -5px 5px 5px #888;

}

This results in a box-shadow that is offset to the left and to the top by 5 pixels with both a blur distance of 5px and a spread distance of 5px.

You can also create an inner shadow by adding the keyword inset to the declaration. This would look like:

#insetboxshadow {

-moz-box-shadow: inset 0 0 5px 5px #888;

-webkit-box-shadow: inset 0 0 5px 5px#888;

box-shadow: inset 0 0 5px 5px #888;

}

This will create an inner shadow that is not offset and both a blur distance of 5px and a spread distance of 5px.

It's also possible to layer multiple shadows, like you can with text-shadow.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you use the CSS3 property text-shadow?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is latest version of css?

The latest version of css is css3


How do you use the CSS3 property box-sizing?

The box-sizing property is an under-appreciated property in CSS3. It accepts only three values, and yet it's benefit to web designers is enormous. The three values are content-box, border-box, and inherit. The browser default is content-box, which is what web designers are use to now. The padding and borders are rendered outside the specified width and height, so an element with a width of 20px with a 1px border and 5px of padding will actually be rendered as 32px wide (20 + 1 + 1 + 5 + 5). By telling the browser to use border-box, the padding and borders are rendered inside the element. So, our example from earlier would be 20px wide total, with 10px of that element taken up by padding and another 2px taken by borders. To achieve this, your CSS code would look like:div.subsection {border: 1px solid #000000;margin: 2px;padding: 2px;width: 50px;height: auto;box-sizing: border-box;}


When was released CSS3?

CSS3 (and HTML5) are in the final stages of ratification and so are not yet official releases. Care must be taken with their features as they will not be fully implemented for years. I find that the LCD (Lowest Common Denominator) practice works best!


Which property is classified as durable?

A property that is classified as durable is an item or asset that is able to withstand wear and tear and has a long lifespan. Examples of durable properties include buildings, machinery, furniture, and vehicles.


How do you determine the size of an array of int passed to a method?

It really depends on the language. In Java, you can use the .length property.

Related questions

How do you put wavy underlining on a word in a webpage maybe using CSS3?

CSS is not capable of doing that. You will need to use an image of some sort.


What is latest version of css?

The latest version of css is css3


What is the latest version of css?

The latest version of css is css3


How do you use the CSS3 property box-sizing?

The box-sizing property is an under-appreciated property in CSS3. It accepts only three values, and yet it's benefit to web designers is enormous. The three values are content-box, border-box, and inherit. The browser default is content-box, which is what web designers are use to now. The padding and borders are rendered outside the specified width and height, so an element with a width of 20px with a 1px border and 5px of padding will actually be rendered as 32px wide (20 + 1 + 1 + 5 + 5). By telling the browser to use border-box, the padding and borders are rendered inside the element. So, our example from earlier would be 20px wide total, with 10px of that element taken up by padding and another 2px taken by borders. To achieve this, your CSS code would look like:div.subsection {border: 1px solid #000000;margin: 2px;padding: 2px;width: 50px;height: auto;box-sizing: border-box;}


How can make the rounded box in css?

Using CSS3 capabilities you can use the {border-radius:?px} property. You can change individual corners radius using topleft, topright, bottomleft, bottomright as follows: {border-radius-topleft:?px} etc. At the time of writing (Sept 2010) this capability is only supported in browsers which use the -moz- and -webkit- prefix as follows: {-moz-border-radius:?px}. The upcoming IE9 will hopefully support this capability.


How do you round div corner in CSS?

In CSS3 we will be able to do this easily using the border-radius property. In most modern web browsers (Internet Explorer being the notable exception) you can achieve a rounded corner (or rounded corners) by using the border-radius property. To do this, in your CSS you would use: border-radius: 15px; It is important to note that IE doesn't support this and so people using IE will not see a round corner. This may or may not be important depending on the purpose for the rounded corners.


Who uses the newest web technology?

Any web designer that uses CSS3 and HTML5 will be up to date on web technology.


How many tag css css3 in HTML?

You can apply as many tags as you want. The CSS tags apply style to the content


How do you name the property of addition?

Use These Property'sAssociative Property Of AdditionCommutative Property Of AdditionAdditive identity Property


How do you use the word property in a sentence?

The property is for sale. A property of water is that it is a liquid.


Can you use the Associative Property with subtraction and division?

No you can not use subtraction or division in the associative property.


What property of multiplication do you use to rename fractions?

Identity property of multiplication