Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

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

  • Last Updated : 14 Sep, 2021

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. 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

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
Recommended Articles
Page :