<s> HTML element, also known as the “strikethrough” element, is used to render text with a horizontal line through it to indicate that the text has been deleted or is no longer valid. It is commonly used to indicate a change or removal in content.
Here’s an example of how to use the
<p>This is <s>no longer valid</s>.</p>
In this example, the text “no longer valid” is wrapped within the
<s> element. When rendered, the text will appear with a horizontal line through it, indicating that it is no longer applicable.
<s> element can be useful in various scenarios, such as indicating deleted or outdated information, highlighting changes in a document, or representing canceled or discontinued items.
It’s important to note that the
<s> element should not be used to represent semantic meaning, as it is purely presentational. For indicating content that has been deleted or is no longer valid, the
<del> element is recommended as it conveys the semantic meaning along with the strikethrough visual style.
In summary, the
<s> element is used to render text with a horizontal line through it, indicating that the text has been deleted or is no longer valid. It is a presentational element and should be used for stylistic purposes rather than conveying semantic meaning. When indicating deleted or no longer applicable content, it is recommended to use the
<del> element for its semantic significance.