The <s> Tag in HTML 5
The HTML <s>
tag for strike out text is used to indicate content that is inaccurate, incorrect or no longer relevant. The s element is one of the phrase elements in HTML. Content inside an s element is often displayed in a strike-through font using a text-decoration: line-through
style property.
The <s>
tag should not be used to indicate a deletion from an HTML document. To provide a standing record of the original text of a blog entry or other actual deletions, the <del> tag should be used instead. The <s> tag should only be used for other purposes, such as:
- to highlight text that is to appear as if it were deleted, sometimes used as humor as in the political correctness "corrections" in
He is
so retardedas dumb as a rock!not so bright. - to mark items as complete in a to do list (although it would be more appropriate to code a
class="complete"
attribute on each item that references a common style with thetext-decoration: line-through
property for the strike-through effect.) - to indicate something that would be considered a mistake if used, as in the examples below.
<s> tag Example
Avoid mismatched quotes in attribute values
Incorrect: <th colspan="3'>
Correct: <th colspan="3">
This shows how the example <s> tag code below would be displayed.