Home  >  Article  >  Web Front-end  >  How to set the thickness of strikethrough in css

How to set the thickness of strikethrough in css

WBOY
WBOYOriginal
2021-12-09 16:41:114782browse

In css, you can use the "text-decoration" attribute to set the thickness of the strikethrough. When the attribute value is "line-through thickness value", a strikethrough will be defined and the thickness of the strikethrough will be set. The syntax is " Element {text-decoration:line-through thickness value}".

How to set the thickness of strikethrough in css

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

How to set the thickness of the strikethrough in css

In css, you can use the text-decoration attribute to set the strikethrough and set the thickness of the strikethrough Value, when the attribute value is line-through, a strikethrough will be defined.

The syntax is as follows:

text-decoration: line-through 删除线粗细值;

The example is as follows:

<html>
<head>
<style type="text/css">
h2 {text-decoration: line-through 15px}
</style>
</head>
<body>
<h2>这是标题 2</h2>
</body>
</html>

Output result:

How to set the thickness of strikethrough in css

<html>
<head>
<style type="text/css">
h2 {text-decoration: line-through 1px}
</style>
</head>
<body>
<h2>这是标题 2</h2>
</body>
</html>

Output result:

How to set the thickness of strikethrough in css

(Learning video sharing: css video tutorial)

The above is the detailed content of How to set the thickness of strikethrough 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