Home > Web Front-end > CSS Tutorial > What is the method to add stroke to text in css

What is the method to add stroke to text in css

王林
Release: 2020-11-17 17:26:58
Original
2334 people have browsed it

The way to add a stroke to text in css is to use the text-shadow attribute to add a stroke, such as [text-shadow: 0 0 5px #FF0000;]. The text-shadow property applies to shadow text, and h-shadow specifies the position of the horizontal shadow.

What is the method to add stroke to text in css

Related properties:

text-shadow property applies to shadow text.

(Learning video sharing: html video tutorial)

Syntax:

text-shadow: h-shadow v-shadow blur color;
Copy after login

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.

Code example:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
    <style> 
        h1 { 
            text-shadow: 0 0 5px #FF0000, 0 0 5px #6bf403; 
        } 
    </style> 
</head> 
<body> 
    <h1>Hello World</h1> 
</body> 
</html>
Copy after login

Achievement effect;

What is the method to add stroke to text in css

Related recommendations:html tutorial

The above is the detailed content of What is the method to add stroke to text in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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