Publish in HTML Tutorial el 25/05/2025 15:58
The <s>
element is used to represent text that is no longer accurate or relevant, typically displayed with a strikethrough effect. Unlike <del>
which indicates deleted text in a document's revision process, <s>
is used for content that is no longer correct but not necessarily deleted in a formal sense.
Here's how to use the <s>
element in its simplest form:
When rendered, it will appear like this: This text is no longer accurate
<del>
might be more semantic)Common e-commerce pattern showing original and sale prices:
Showing corrected information while keeping the original (now incorrect) text:
Customizing the appearance of the strikethrough:
Using JavaScript to toggle strikethrough on click:
Animating the strikethrough effect with JavaScript:
<s>
for stylistic strikethroughs, not for document edits (use <del>
for that)<s>
with <ins>
for the new priceThe <s>
element is supported in all modern browsers and has excellent backward compatibility.
The <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <source> element is used to specify multiple media resources for media elements like &l...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...