HTML <s> tag

Updated: 04/09/2024 by Computer Hope
HTML s tag

When writing in HTML (hypertext markup language), the <s> tag is an inline element used to create a strikethrough on a section of text. It is useful for designating text that is no longer relevant or correct in some way. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Note

To define replaced or deleted text, use <ins> and <del> tags instead of <s>.

Example of <s> code

<p><s>We have six puppies left for sale.</s></p>
<p>We have five puppies left for sale.</p>

Example result

We have six puppies left for sale.

We have five puppies left for sale.

Attributes

All HTML tags support standard attributes that define the settings of an HTML element. Unlike other HTML tags, the <s> tag has no unique attributes.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All versions All versions All versions

Should I use the <del> or <s> tag?

The <s> tag should be used if the text is no longer relevant, incorrect, or obsolete. The <del> tag should be used if the text was deleted but needs to remain for historical reasons. For example, you may use the <s> tag to cross out the previous price of a product and use <del> to show sold products.

Browser, Compatibility, Container tag, HTML strike tag, Web design terms