Skip to content
Related Articles
Open in App
Not now

Related Articles

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

Improve Article
Save Article
  • Last Updated : 14 Sep, 2021
Improve Article
Save Article

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:

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 text-decoration property in CSS. This property specifies the decoration added to the text.

Syntax:

text-decoration: line-through;

Example:

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: 


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!