Open In App

How to Mark Strikethrough Text in HTML?

Last Updated : 15 Nov, 2024
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

Strikethrough text is a visual formatting style where a horizontal line is drawn through characters. For example, Strikethrough Text. It is commonly used to indicate that text is no longer valid, has been deleted, or that changes or corrections have been made.

1. Strikethrough Text using <s> Tag

The <s> tag renders text with a strikethrough effect. The <s> tag defines text that should be presented with a strikethrough effect.

HTML
<p>
	GeeksforGeeks is a <s>Math</s>
    Computer Science Portal.
</p>

Output

Output
Strikethrough Text

2. Strikethrough Text using <del> Tag

The <del> tag is used to indicate deleted text, typically rendering it with a strikethrough effect by default. The deleted text is rendered as strike-through text by the web browsers.

HTML
<p>
	GeeksforGeeks is a <del>Math</del>
    Computer Science Portal.
</p>

Output

Output
Strikethrough Text

3. Strikethrough Text Using <strike> Tag

The <strike> tag is a deprecated HTML tag that was used to render text with a strikethrough effect. While it is still supported in most browsers, it is recommended to use the <s> or <del> tags instead.

HTML
<p>
	GeeksforGeeks is a <strike>Math</strike>
    Computer Science Portal.
</p>

Output

Output
Strikethrough Text

4. Strikethrough Text using CSS

You can also use CSS to style text with a strikethrough effect, giving you more control over its appearance. To add strikethrough effect on text, text-decoration property is used.

HTML
<p>
	GeeksforGeeks is a 
    <span style="text-decoration: line-through;">Math</span>
    Computer Science Portal.
</p>

Output

Output
Strikethrough Text

Article Tags :

Similar Reads