<s>

Term side of the Card.
Topic: Formatting
Unit title: <s>
Categories: Tag
Explanation side of the Card

Explanation: The element that represents text that is no longer accurate or relevant, usually shown with a strikethrough, like an old price. For removed text in a document edit, `<del>` is used instead.

Browser compatibility:
  • The chrome browser supports this feature starting from version 1.
  • The edge browser supports this feature starting from version 12.
  • The firefox browser supports this feature starting from version 1.
  • The safari browser supports this feature starting from version 4.
Availability: 

Example

Wronghtml
<p>
  <span style="text-decoration: line-through">$40</span> $25
</p>
Righthtml
<p>
  Was <s>$40</s>, now $25
</p>

<s> marks the old price as no longer accurate, and the words 'was' and 'now' keep the meaning without the style.

Common mistakes

  • Expecting screen readers to announce the strikethrough, which most do not by default.

Key points

  • <s> marks content that is no longer accurate, like an old price.
  • Edits to a document use <del> and <ins>, not <s>.

Interview questions

Do screen readers announce s text as struck through?

Most do not by default. Add words like 'was' and 'now' in the text so the meaning is clear.

Is the strike tag still valid?

No, <strike> is obsolete. Use <s> for outdated content or <del> for removed edits.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy