Home  >  Article  >  Web Front-end  >  How to add stroke to text in css

How to add stroke to text in css

王林
王林Original
2020-11-16 10:34:463652browse

How to add strokes to text in css: You can use the text-shadow attribute to add strokes to text, such as [text-shadow: 0 0 5px #FF0000, 0 0 5px #6bf403;]. The text-shadow property applies to shadow text.

How to add stroke to text in css

Property introduction:

text-shadow property is applied to shadow text.

(Learning video sharing: css video tutorial)

Grammar:

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

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>

Effect:

How to add stroke to text in css

Related recommendations: CSS tutorial

The above is the detailed content of How to add stroke to text 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