How to mark strikethrough text in HTML?


To mark strikethrough text in HTML, use the <strike>…</strike> tag. It renders a strikethrough text. HTML deprecated this tag and it shouldn’t be used in HTML5. As an alternative, use the CSS text-decoration property.

To use the CSS property, use the style attribute. The style attribute specifies an inline style for an element. The attribute can be used with the HTML <p> tag. Just keep in mind, HTML5 does not support the <strike> tag, so the CSS style should be used.

Strikethrough

Example

You can try to run 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

Sai Subramanyam
Sai Subramanyam

Passionate, Curious and Enthusiastic.

Updated on: 29-Dec-2021

9K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements