Home >Web Front-end >CSS Tutorial >How to set text stroke effect in css

How to set text stroke effect in css

王林
王林Original
2020-11-20 17:26:0410621browse

How to set the text stroke effect in css: You can use the text-stroke-color attribute to set it, such as [-webkit-text-stroke-color:#ff0;]. The attribute text-stroke-color is used to set or retrieve the stroke color of text in the object.

How to set text stroke effect in css

Related properties:

text-stroke-color: property sets or retrieves the stroke color of the text in the object

(Learning video sharing: css video tutorial)

Attribute value:

: Specify the stroke color of the text.

Compatibility:

How to set text stroke effect in css

Example:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>text-stroke-color</title>
<style>
html,body{font:bold 14px/1.5 georgia,simsun,sans-serif;text-align:center;}
.stroke h1{margin:0;padding:10px 0 0;}
.stroke p{
margin:50px auto 100px;font-size:100px;
-webkit-text-stroke-width:2px;
-webkit-text-stroke-color:#ff0;
}
.copyright,.info{font-style:italic;}
</style>
</head>
<body>
<body>
<div>
<h1>描边的文字:</h1>
<p>我是被描了2像素黄边的文字</p>
</div>
</body>
</html>

Related recommendations: CSS tutorial

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