HTML tags | s

It is used to indicate a text that is no longer correct, accurate or relevant, and that is usually rendered with a line through it.

It is not suitable for indicating edits in a document, that’s what the <del> and <ins> elements exist for.


This content originally appeared on DEV Community and was authored by Carlos Espada

It is used to indicate a text that is no longer correct, accurate or relevant, and that is usually rendered with a line through it.

It is not suitable for indicating edits in a document, that's what the <del> and <ins> elements exist for.

The presence of the <s> element is not advertised in most screen readers with the default settings. You can force your ad using the content property of CSS as well as the ::before and ::after pseudo-elements as follows:

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 screen reader users disable content ad to avoid excessive verbosity. So it is important not to abuse this technique, avoiding using it whenever possible, except in situations where not knowing that there is a crossed-out content can adversely affect the understanding of the text.

  • Type: inline
  • Self-closing: No
  • Semantic value: No

Definition | Example | Support


This content originally appeared on DEV Community and was authored by Carlos Espada


Print Share Comment Cite Upload Translate Updates
APA

Carlos Espada | Sciencx (2021-09-20T06:24:14+00:00) HTML tags | s. Retrieved from https://www.scien.cx/2021/09/20/html-tags-s/

MLA
" » HTML tags | s." Carlos Espada | Sciencx - Monday September 20, 2021, https://www.scien.cx/2021/09/20/html-tags-s/
HARVARD
Carlos Espada | Sciencx Monday September 20, 2021 » HTML tags | s., viewed ,<https://www.scien.cx/2021/09/20/html-tags-s/>
VANCOUVER
Carlos Espada | Sciencx - » HTML tags | s. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/20/html-tags-s/
CHICAGO
" » HTML tags | s." Carlos Espada | Sciencx - Accessed . https://www.scien.cx/2021/09/20/html-tags-s/
IEEE
" » HTML tags | s." Carlos Espada | Sciencx [Online]. Available: https://www.scien.cx/2021/09/20/html-tags-s/. [Accessed: ]
rf:citation
» HTML tags | s | Carlos Espada | Sciencx | https://www.scien.cx/2021/09/20/html-tags-s/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.