📜  HTML |<strike>标签<strike>(1)

📅  最后修改于: 2023-12-03 14:41:53.074000             🧑  作者: Mango

HTML Strikethrough Tag

The HTML Strikethrough Tag, also known as the <strike> tag, is used to strike out or make a line through a piece of text. This tag is commonly used when updating or editing text to show what has been removed.

Syntax

The syntax for using the <strike> tag is as follows:

<strike>text to be striked out</strike>
Example

Here is an example of using the <strike> tag:

<p> This sentence has been <strike>removed</strike> updated. </p>

This will render as:

This sentence has been removed updated.

Deprecated

However, the <strike> tag has been depreciated since HTML 4.01 and is no longer recommended for use. Instead, the <s> tag or the <del> tag should be used instead.

Syntax

The s tag syntax is as follows:

<s>text to be striked out</s>

The del tag syntax is as follows:

<del>text to be striked out</del>
Example

Here is an example of using the s tag:

<p> This sentence has been <s>removed</s> updated. </p>

This will render as:

This sentence has been removed updated.

Here is an example of using the del tag:

<p> This sentence has been <del>removed</del> updated. </p>

This will render as:

This sentence has been removed updated.

Conclusion

While the <strike> tag can still be used, it is recommended to instead use the <s> tag or <del> tag as they are more up to date and supported across all modern browsers.