Home >Web Front-end >CSS Tutorial >How to make text have shadow in css

How to make text have shadow in css

王林
王林Original
2020-11-20 14:09:254509browse

How to add a shadow to text in css: You can add a shadow to the text by using the text-shadow attribute, such as [text-shadow: 2px 2px #ff0000;]. The text-shadow property is specifically applied to shadow text in CSS.

How to make text have shadow in css

Related properties:

The text-shadow property applies to shadow text.

(Learning video sharing: css video tutorial)

Syntax:

text-shadow: h-shadow v-shadow blur color;

The text-shadow property connects one or more shadow texts. The property is a shadow, specifying every 2 or 3 length values ​​and an optional color value separated by commas. The expired length is 0.

Attribute 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:

h1
{
    text-shadow: 2px 2px #ff0000;
}

Related recommendations: CSS tutorial

The above is the detailed content of How to make text have shadow 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