The HTML <s>
element 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.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Content categories | Phrasing content, 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. |
Implicit ARIA role | No corresponding role |
Permitted ARIA roles | Any |
DOM interface | HTMLElement
|
Attributes
This element only includes the global attributes.
Implementation note: Up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement
interface for this element.
Examples
<s>Today's Special: Salmon</s> SOLD OUT<br>
<span style="text-decoration:line-through;">Today's Special:
Salmon</span> SOLD OUT
Accessibility concerns
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.
- Short note on making your mark (more accessible) | The Paciello Group
- Tweaking Text Level Styles | Adrian Roselli
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living StandardThe definition of 's element' in that specification. | Living Standard | |
HTML5The definition of 's element' in that specification. | Recommendation |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
s
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox Full support 1 Full support 1 Notes' Before Firefox 4, this element implemented the |
IE
Full support Yes |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support 4 |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
- See implementation notes.'
- See implementation notes.
See also
- The
<strike>
element, alter ego of the<s>
element is obsolete and should not be used on Web sites any more. - The
<del>
element is to be used instead if the data has been deleted. - The CSS
text-decoration-line
property is to be used to achieve the former visual aspect of the<s>
element.
<s> by Mozilla Contributors is licensed under CC-BY-SA 2.5.