The <s>
renders text with a strikethrough, or a line through it. Use the <s>
element to represent things that are no longer relevant or no longer accurate. However, <s>
is not appropriate when indicating document edits; for that, use the <del>
and <ins>
elements, as appropriate.
Content categories | Phrasing content or flow content. |
---|---|
Permitted content | Phrasing content. |
Tag omission | None, both the starting and ending tag are mandatory. |
Permitted parents | Any element that accepts phrasing content. |
Permitted ARIA roles | Any |
DOM interface | HTMLElement |
This element only includes the global attributes.
HTMLSpanElement
interface for this element.<s>Today's Special: Salmon</s> SOLD OUT<br> <span style="text-decoration:line-through;">Today's Special: Salmon</span> SOLD OUT
Today's Special: Salmon SOLD OUT
Today's Special: Salmon SOLD OUT
The presence of the s
element is not announced by most screen reading technology in its default configuration. It can be made to be announced by using the CSS content
property, along with the ::before
and ::after
pseudo-elements.
s::before, s::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } s::before { content: " [start of stricken text] "; } s::after { content: " [end of stricken text] "; }
Some people who use screen readers deliberately disable announcing content that creates extra verbosity. Because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been struck out would adversely affect understanding.
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 's element' in that specification. | Living Standard | |
HTML5 The definition of 's element' in that specification. | Recommendation |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | Yes | 1
|
Yes | Yes | Yes |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | Yes | 4 | Yes | Yes | Yes |
<strike>
element, alter ego of the <s>
element is obsolete and should not be used on Web sites any more.<del>
element is to be used instead if the data has been deleted.text-decoration
-line-through property is to be used to achieve the former visual aspect of the <s>
element.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s