Open In App

How to display incorrect content using HTML?

Last Updated : 19 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

To display the text that is not correct by using the <s> tag in the document. This tag is similar but slightly different from the <del> tag.

Note: It is not used to replaced or delete text but the <del> tag is used to replace or delete the text.  

Syntax:

<s> Contents... </s>

Example 1: In the example, use <s> tags around text that is no longer accurate to visually indicate strikethrough content, such as outdated information, within HTML documents.

html
<!DOCTYPE html>
<html>

<head>
	<title>
		How to define text that
		is no longer correct
	</title>

	<style>
		body {
			text-align: center;
		}

		.geeks {
			font-size: 25px;
			font-weight: bold;
		}

		p {
			font-size: 20px;
		}
	</style>
</head>

<body>


	<div class="geeks">
		Text
		that is no longer correct
	</div>

	<p>
		GeeksforGeeks is a
		<s>computer science</s>
		portal for geeks
	</p>
</body>

</html>

Output:

deltag

Output

Example 2: The example display incorrect content using HTML5.

html
<!DOCTYPE html>
<html>

<head>
    <title>
        How to define text that
        is no longer correct
    </title>
</head>

<body>
    <p>
        <s>
            Present version of 
            HTML is HTML 4.01.
        </s>
    </p>

    <p>
        Next version of 
        HTML is HTML 5
    </p>
</body>

</html>

Output:

Supported Browsers

  • Google Chrome: 129
  • Firefox: 130
  • Opera: 110
  • Safari: 17.6




Next Article

Similar Reads