HTML <s> tag
The <s> tag is used to define characters (mostly text) that is no longer accurate or related.
The texts within this element will be rendered in strike-through text.
Type: Inline Element
Syntax of <s> tag
<s>Inaccuate content</s>
Supported Browsers
| Tag | Chrome | Internet Explorer | Firefox | Safari | Opera Mini |
|---|---|---|---|---|---|
| <s> | Yes | Yes | Yes | Yes | Yes |
There are three HTML tags that can make strike-through text. - <del>, <s> and <strike>.
The texts or characters within all these elements will be rendered in the same style (line-through) but their purposes and when to use are different.
| Tag | Purpose | Valid in HTML5 |
|---|---|---|
| <del> | make changes in the document (history or time related event) | ✔ |
| <s> | make changes that is no longer accurate (price, outdated info) | ✔ |
| <strike> | just to create line-through texx without any signifant. | ✖ |
Full code example
<!DOCTYPE html> <html> <head> </head> <body> <p> The product costs <del> Rs.999 </del> Rs. 499 only. </p> </body> </html>
Output on the browser
The product costs Rs.999 Rs. 499 only.
More reference
Both <del> and <s> tags have semantic meaning. You can also use the <strike> tag to create strike-through text, but the <strike> tag was removed in HTML5.
Default CSS property of <s> tag
s { text-decoration:line-through; }
