Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use CSS3 text special effects attribute text-shadow

Shulou Source: shulou.com Published: 2022-06-01 10:57:13 09月27日 Update

Editor to share with you how to use the CSS3 text special effects attribute text-shadow. I hope you will get something after reading this article. Let's discuss it together.

1. How to write text-shadow

Text-shadow is the CSS3 style attribute, which is the CSS style that sets whether the text font of the text has shaded and blurred effects.

Syntax: text-shadow:x-offsety-offsetblurcolor

The parameters of text-shadow are as follows:

X-offset: required, horizontal shadow offset, can be negative

Y-offset: required, vertical shadow offset, can be negative

Blur: optional, shadow blur radius, not negative

Color: optional, shadow color

Second, the simple use of text-shadow

For example: set class named A1 div text shadow red, shadow distance to the left and top for 3px and 4px, shadow size blur range for 5px, setting class name for a2 div text shadow black, shadow distance left and top for 1px, shadow range size 2px.

Html Code:

Life is more than the present.

Life is more than the present.

Life is more than the present.

CSS Code:

.a1 {text-shadow:3px4px5px#F00}

.a2 {text-shadow:1px1px2px#000}

Picture display:

Text-shadow2.jpg

III. Examples of CSS3 text shadow

Description: use text-shadow in CSS3 to add a flame-like effect to the text.

.a1 {width:200px;height:200px;background:#000000;text-align:center;line-height:200px;font-size:40px;font-weight:bold

Text-shadow:004pxwhite

0-5px4px#ff3

3px-10px6px#fd3

-3px-15px11px#C90

3px-25px18px#f20

}

Story of Yanxi Palace

After reading this article, I believe you have a certain understanding of "how to use CSS3 text special effects attribute text-shadow". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Shadows text attributes negative values life special effects code size effect direction style article range offset usage writing radius parameters pictures picture display Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information OPPO Reno Linux NVidia MySQL