Home > Web Front-end > Front-end Q&A > How to add shadow effect to fonts in css

How to add shadow effect to fonts in css

藏色散人
Release: 2022-12-30 11:11:15
Original
8554 people have browsed it

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;
Copy after login

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>
Copy after login

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template