w3resource

HTML5: How to define text that is no longer correct?

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html><!-- Define document type as HTML5 -->
<html><!-- Start of HTML document -->
<head><!-- Start of head section -->
<meta charset="utf-8"><!-- Define character encoding -->
<title>How to define text that is 
no longer correct</title><!-- Title of the document -->
</head><!-- End of head section -->
<body><!-- Start of body section -->
<p><s>Present version of HTML is HTML 
4.01.
</s></p><!-- Define a paragraph with text marked as no longer correct -->
<p>Next version of HTML is HTML 5</p><!-- Define a paragraph with updated information -->
</body><!-- End of body section -->
</html><!-- End of HTML document -->

Explanation:

  • This HTML code demonstrates how to define text that is no longer correct using the <s> element.
  • Inside a <p> (paragraph) element, text indicating the present version of HTML is included within the <s> element, which denotes that the text is no longer accurate.
  • The <s> element is used to represent content that is no longer correct or relevant.
  • The text "Present version of HTML is HTML 4.01." is marked as no longer correct using the <s> element.
  • Another <p> element contains updated information, indicating that the next version of HTML is HTML 5.
  • The <s> element is commonly used in cases where content needs to be struck through to indicate that it is outdated or incorrect.

Live Demo:

See the Pen s-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
Yes Yes Yes Yes Yes

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.