Description

The HTML element <s> is used to define a strike-through text.

It specifies the text is no longer correct, accurate, or relevant, so it is displayed with a strike-through line across the text.

It should not be used to define a deleted text, as the correct element to define it is using <del> element.

  • Both <s> and <del> elements display the text with a strike-through, but they are used to define different types of texts.

The below table summarizes its usage.

Usage Details
Placement It is displayed as an Inline element.
Contents It can contain Inline elements and text.
Tags Both the opening and closing tags are required.
Versions HTML 4, 4.01, 5

Syntax

Here is the basic syntax of the <s> element.

<s>...</s>

Examples

Run this on IDE

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Example - HTML Element s</title>
</head>
<body>
    <p>This paragraph contains a <s>strikethrough</s> text.</p>
</body>
</html>

Attributes

The following table shows the list of supported and unsupported attributes for the <s> element.

Attribute Type Details
Element-Specific Attributes The tag <s> doesn't have any element-specific attributes.
Global Attributes Like all other HTML tags, the tag <s> supports the HTML Global Attributes.
Event Attributes The tag <s> also supports the HTML Event Attributes.

Browser Compatibility

The tag <s> is supported in all modern browsers.

  • Google Chrome 1+
  • Internet Explorer or Edge 2+
  • Firefox 1+
  • Apple Safari 1+
  • Opera 4+

Related Links