How to add a shadow effect to a font in css: First create an HTML sample file; then add a shadow effect to the specified font through the attribute "text-shadow: 5px 5px 5px #FF0000;".
The operating environment of this tutorial: windows7 system, HTML5&&CSS3 version, Dell G3 computer.
Related recommendations: "css video tutorial"
text-shadow property sets a shadow effect to text.
Syntax:
text-shadow: h-shadow v-shadow blur color;
Comments: The text-shadow property adds one or more shadows to text. This property is a comma-separated list of shades, each shade specified with two or three length values and an optional color value. The omitted length is 0.
Property value:
h-shadow Required. The position of the horizontal shadow. Negative values are allowed.
v-shadow Required. The position of the vertical shadow. Negative values are allowed.
blur Optional. Blurred distance.
color Optional. The color of the shadow.
Example:
<!DOCTYPE html> <html> <head> <style> h1 { text-shadow: 5px 5px 5px #FF0000; } </style> </head> <body> <h1>文本阴影效果!</h1> </body> </html>
Rendering:
For more programming-related knowledge, please visit:Programming Teaching ! !
The above is the detailed content of How to add shadow effect to fonts in css. For more information, please follow other related articles on the PHP Chinese website!