Open In App

How to Mark Deleted Text in HTML?

Last Updated : 17 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

In HTML, you can mark text as deleted to indicate that it has been removed from the document. This is often displayed with a strikethrough effect. There are different methods to mark deleted text in HTML, including using the <del> tag, the <s> tag, and the <strike> tag.

Approach 1: Using the <del> Tag

The <del> tag is used to mark text that has been deleted from the document. By default, browsers typically render text within the <del> tag with a strikethrough effect.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Deleted Text</title>
</head>

<body>
    <p>This is <del>deleted</del> text.</p>
</body>

</html>

Output:

This is deleted text.

Approach 2: Using the <s> Tag

The <s> tag is a generic tag for strikethrough text, and it can be used to mark deleted text as well.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Deleted Text</title>
</head>

<body>
    <p>This is <s>deleted</s> text.</p>
</body>

</html>

Output:

This is deleted text.

Approach 3: Using the <strike> Tag

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

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Deleted Text</title>
</head>

<body>
    <p>This is <strike>deleted</strike> text.</p>
</body>

</html>

Output:

This is deleted text.

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads