Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

<s>: The Strikethrough element

BaselineWidely available

The<s>HTML 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.

Try it

<p><s>There will be a few tickets available at the box office tonight.</s></p><p>SOLD OUT!</p>
s {  /* Add your styles here */}

Attributes

This element only includes theglobal attributes.

Accessibility

The presence of thes element is not announced by most screen reading technology in its default configuration. It can be made to be announced by using the CSScontent property, along with the::before and::after pseudo-elements.

css
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.

Examples

css
.sold-out {  text-decoration: line-through;}
html
<s>Today's Special: Salmon</s> SOLD OUT<br /><span>Today's Special: Salmon</span> SOLD OUT

Result

Technical summary

Content categoriesPhrasing content,flow content.
Permitted contentPhrasing content.
Tag omissionNone, both the starting and ending tag are mandatory.
Permitted parents Any element that acceptsphrasing content.
Implicit ARIA roledeletion
Permitted ARIA rolesAny
DOM interfaceHTMLElement

Specifications

Specification
HTML
# the-s-element

Browser compatibility

See also

  • The<strike> element, alter ego of the<s> element, is obsolete and should not be used on websites anymore.
  • The<del> element is to be used instead if the data has beendeleted.
  • The CSStext-decoration-line property is to be used to achieve the former visual aspect of the<s> element.

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp