<strike> Tag in HTML | Text Formatting
The <strike> tag in HTML is used to display text with a line through it, commonly known as "strikethrough." This tag is often used to indicate that a piece of content is no longer relevant or valid.
Key Points on <strike> Tag:
- The <strike> tag displays text with a line through it.
- It is used for strikethrough text to show that something has been deleted, is obsolete, or is incorrect.
- In modern HTML, the <s> tag is recommended for a similar effect, as the <strike> tag is considered deprecated in HTML5.
- The <strike> tag does not affect the semantics of the document, only the visual presentation.
Syntax of <strike> Tag:
Syntax Example
<strike>Text with strikethrough</strike>
Example of <strike> Tag in HTML:
This example demonstrates the usage of the <strike>
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 Strike Tag Example</title>
</head>
<body>
<h1>HTML Strike Tag Example</h1>
<p>
The price of the product was <strike>$50</strike> now it's <strong>$40</strong>.
</p>
</body>
</html>
Output
HTML Strike Tag Example
The price of the product was
The <strike>
tag is used to display strikethrough text, commonly used for text that is no longer valid or has been replaced. Although it is still supported, it is recommended to use the <s>
tag in modern HTML for the same effect.