🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

<strike>

AI & DATA SCIENCE // strike-tag

The deprecated <strike> element rendered a strikethrough line through text; it has been replaced by <s> (no-longer-relevant content) or <del> (a tracked deletion) in HTML5.

Syntax

<!-- Deprecated: -->
<strike>Old text</strike>
<!-- Modern equivalent: -->
<s>Old text</s>

Deep Dive Course

**`<strike>`** was a purely presentational element from HTML4 with no semantic meaning beyond 'draw a line through this'. HTML5 removed it in favor of two more meaningful alternatives: `<s>` for content that is simply no longer accurate or relevant, and `<del>` for representing a deliberate, trackable deletion from a document (often paired with `<ins>`). Modern browsers don't apply any special styling to `<strike>` at all.

1Understanding <strike>

`<strike>` was a purely presentational element from HTML4 with no semantic meaning beyond 'draw a line through this'. HTML5 removed it in favor of two more meaningful alternatives: <s> for content that is simply no longer accurate or relevant, and <del> for representing a deliberate, trackable deletion from a document (often paired with <ins>). Modern browsers don't apply any special styling to <strike> at all.

💡

When migrating old <strike> markup, ask whether it's showing 'outdated content' (use <s>) or 'a document edit being tracked' (use <del>) — they're not interchangeable even though both render as strikethrough.

editor.html
<!-- Old, deprecated markup -->
<p><strike>Limited time offer</strike></p>
localhost:3000

2Practical Example

Here is a real-world application of <strike> showing how it is used in production HTML.

editor.html
<!-- Correct modern replacement -->
<p><s>Limited time offer</s> — now extended through March!</p>
localhost:3000

3Best Practices

Follow these guidelines when working with <strike>:

1. Never use <strike> in new code — it's obsolete

2. Replace with <s> for simply outdated/no-longer-relevant content

3. Replace with <del> when representing a specific document edit, ideally paired with <ins>

⚠️

Tip: When migrating old <strike> markup, ask whether it's showing 'outdated content' (use <s>) or 'a document edit being tracked' (use <del>) — they're not interchangeable even though both render as strikethrough.

editor.html
<!-- Old, deprecated markup -->
<p><strike>Limited time offer</strike></p>
localhost:3000

Examples

Example 01Basic Usage
<!-- Old, deprecated markup -->
<p><strike>Limited time offer</strike></p>
Example 02Advanced Example
<!-- Correct modern replacement -->
<p><s>Limited time offer</s> — now extended through March!</p>

Best Practices

  • Never use in new code — it's obsolete
  • Replace with for simply outdated/no-longer-relevant content
  • Replace with when representing a specific document edit, ideally paired with

Interview Question

When migrating legacy <strike> markup, how do you decide between <s> and <del>?

Hint: Think about whether you're documenting a specific edit versus just marking content as outdated.

If the strikethrough is just showing that something is no longer true or relevant — like an old price or a finished task — <s> is the right replacement. If it's specifically representing a tracked change to a document, like a legal redline or a diff showing what text was removed (usually alongside <ins> for what was added), <del> is more precise and supports datetime/cite attributes for recording when and why the edit happened.

Exercises

EasyPractice using <strike> in a real scenario.
View Solution
<!-- Old, deprecated markup -->
<p><strike>Limited time offer</strike></p>

Frequently Asked Questions

When migrating legacy <strike> markup, how do you decide between <s> and <del>?

If the strikethrough is just showing that something is no longer true or relevant — like an old price or a finished task — is the right replacement. If it's specifically representing a tracked change to a document, like a legal redline or a diff showing what text was removed (usually alongside for what was added), is more precise and supports datetime/cite attributes for recording when and why the edit happened.

Related Functions

s-tagins-tag