Strikethrough Text using CSS
You can also use CSS to style text with a strikethrough effect, giving you more control over its appearance. To add strikethrough effect on text, text-decoration property is used.
<!DOCTYPE html>
<html>
<head>
<title>Strikethrough Text</title>
<style>
.strikethrough-text {
text-decoration: line-through;
}
</style>
</head>
<body>
<p>
w3wiki is a
<span class="strikethrough-text">Math</span>
Computer Science Portal.
</p>
</body>
</html>
Output:
w3wiki is aMathComputer Science Portal.
How to Mark Strikethrough Text in HTML?
Strikethrough Text is a visual formatting style applied to text where a horizontal line is drawn through the characters. For Example – Strikethrough Text. It is commonly used to indicate that the text is no longer valid, deleted, or that there has been a change or correction made to the content.
There are several methods to achieve this, including the <s>, <del>, and <strike> tags, as well as using CSS. In this article, we will cover all approaches to mark strikethrough text in HTML.
Table of Content
- Using the <s> Tag
- Using the <del> Tag
- Using the <strike> Tag
- Using CSS