Home  >  Article  >  Web Front-end  >  How to add strikethrough to text in HTML? (code example)

How to add strikethrough to text in HTML? (code example)

藏色散人
藏色散人Original
2018-10-08 16:26:1817171browse

This article mainly introduces to you the specific use of HTML strikethrough tags.

In the previous article [How to set the strikethrough style with css? ], we have introduced to you the specific implementation method of realizing the strikethrough style through CSS. Friends in need can go and refer to it.

Let’s use a simple code example to introduce how to use the tag in HTML to add a strikethrough in the middle of text!

html strikethrough codeThe example is as follows:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>html删除线代码示例</title>

</head>
<body>
    <s>这段文字已经被删除</s>
</body>
</html>

The code implementation effect is as follows:

How to add strikethrough to text in HTML? (code example)

We can already see from the picture that this text has been struck through. Here we mainly use the tag in html.

As in the above code, just write the text that needs to be strikethrough directly in the tag!

Summary:

The tag is a definable strikethrough text definition, that is, the modified text content will be strikethrough (a line in the middle of the text).

The tag is the abbreviated version of the tag, which is supported by both Netscape and Internet Explorer.

Note:

In HTML 4.01, the tag is deprecated.

In XHTML 1.0 Strict DTD, the tag is not supported.

Suggestion:

Please use instead!

In the follow-up article [Detailed explanation of adding strikethrough to HTML text tag], we will introduce how to use the tag, please Stay tuned everyone!

This article is an introduction to the implementation method of HTML strikethrough. It is very easy to understand. I hope it will be helpful to friends in need!

The above is the detailed content of How to add strikethrough to text in HTML? (code example). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn