<s> Tag in HTML | Text Formatting
The <s> tag in HTML is used to indicate text that is no longer accurate or relevant. The text enclosed within this tag is typically displayed with a strikethrough effect.
Key Points on <s> Tag:
- The <s> tag is used to represent text that is no longer relevant or correct but should be visually shown in the document.
- The text inside the <s> tag is typically rendered with a strikethrough (crossed-out) style.
- The <s> tag does not imply any semantic meaning; it's purely for styling.
- This tag is useful when indicating errors, outdated information, or changes that need to be visually marked.
Syntax of <s> Tag:
Syntax Example
<s>Text to be struck through</s>
Example of <s> Tag in HTML:
This example demonstrates the usage of the <s>
tag to show text with a strikethrough effect.
Code Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML <s> Tag Example</title>
</head>
<body>
<h1>HTML <s> Tag Example</h1>
<p>
This is a regular sentence. <s>This part is no longer relevant</s> and should be struck through.
</p>
</body>
</html>
Output
Example
This is a regular sentence.The <s> tag is used to visually indicate that some text is no longer valid or relevant, typically by showing a strikethrough. It is often used for corrections, deletions, or updates in content, though it does not imply any semantic meaning.