html
  1. html-s-tag

HTML <s> Tag

  • The HTML <s> tag represents text that is no longer accurate or relevant.
  • It is a strikethrough text that indicates that the text has been deleted or removed.

Syntax

The basic syntax of the <s> tag is as follows:

<s>Text that should be strikethrough</s>

Example

Consider the following example:

<p>The price of the product is <s>$20</s> $15.</p>
Try Playground

Explanation

The <s> tag is used to indicate that the text within the tag has been deleted or is no longer accurate. It is often used to show that a text has been replaced by another text.

Use

The <s> tag is typically used in scenarios where you need to indicate that a text has been deleted or is no longer accurate. It is commonly used in:

  • E-commerce websites to indicate a reduced or expired price.
  • Writing workflows to indicate that text was deleted in editing/reviewing process.
  • Version control systems to indicate that a code or markup was removed from the document.

Important Points

  • The <s> tag is not recommended for indicating text that needs to be corrected. Use the <del> tag in that case.
  • The strikethrough effect of the text can be set differently using CSS, although it is not recommended as it goes against the default convention.

Summary

The HTML <s> tag is used to indicate text that has been deleted or is no longer accurate. It is commonly used in e-commerce websites, writing workflows, and version control systems to show that a text has been replaced by another text. However, it is not recommended for indicating text that needs to be corrected. The default strikethrough effect of the text can be customized using CSS.

Published on: