Open In App

How to define the text that is no longer correct in HTML5 ?

Last Updated : 16 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will learn how to define the text that is no longer correct in HTML5. Before starting this content we assume that you have a basic knowledge of HTML.

Approach 1: To do this we are going to use the <s> tag. <s> tag is an HTML tag that is used to specify the text that is no longer correct, accurate, or relevant. This tag should not be used to define the deleted text in a document for this we use the <del> tag. 

Syntax:

<s> write some text here </s>

Example: In this example, we will use <s> tag.

HTML




<!DOCTYPE html>
<html>
<body>
    <h2>Welcome To GFG</h2>
    <p>I love <s>rotten</s>fresh vegetables</p>
</body>
</html>
</html>


Output:

Approach 2: We can perform the same task by using the text-decoration property in CSS. This property specifies the decoration added to the text.

Syntax:

text-decoration: line-through;

Example: In this example, we will use the above approach.

HTML




<!DOCTYPE html>
<html>
<head>
    <style>
        span {
            text-decoration: line-through;
        }
    </style>
</head>
<body>
    <h2>Welcome To GFG</h2>
    <p>I love<span> rotten </span>fresh vegetables</p>
</body>
</html>


Output: 



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

Similar Reads