Home  >  Article  >  Web Front-end  >  How to add shadow effect to fonts in css

How to add shadow effect to fonts in css

藏色散人
藏色散人Original
2021-01-07 09:45:168527browse

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;".

How to add shadow effect to fonts in css

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:

How to add shadow effect to fonts in css

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn