Home  >  Article  >  Web Front-end  >  How to mark strikethrough text in HTML?

How to mark strikethrough text in HTML?

WBOY
WBOYforward
2023-08-25 22:45:192050browse

To mark strikethrough text in HTML, use the tag. It will render a strikethrough text. This tag has been deprecated by HTML and should not be used in HTML5. As an alternative, you can use the CSS text-decoration property.

To use CSS properties, use the style attribute. The style attribute specifies inline styles for the element. This attribute can be used with the HTML

tag. Keep in mind that HTML5 does not support the tag, so CSS styling should be used.

How to mark strikethrough text in HTML?

Example

You can try running the following code to mark strikethrough text in HTML

<!DOCTYPE html>
<html>
<head>
<title>HTML Strikethrough text</title>
</head>

<body>
<h1>Heading</h1>
<p style="text-decoration: line-through;">
Strikethrough text
</p>
</body>
</html>

Output

How to mark strikethrough text in HTML?

The above is the detailed content of How to mark strikethrough text in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete