Cover Image for HTML strike Tag
65 views

HTML strike Tag

The HTML <strike> tag was used in older versions of HTML to create a strikethrough effect on text. However, it is now considered deprecated and is no longer recommended for use. Instead, the CSS text-decoration property should be used to achieve the strikethrough effect.

To apply a strikethrough effect to text using CSS, you can use the following style rule:

HTML
<style>
  .strikethrough {
    text-decoration: line-through;
  }
</style>

Then, you can apply the “strikethrough” class to the desired HTML element:

HTML
<p>This text is <span class="strikethrough">strikethrough</span> text.</p>

In the above example, the <span> element with the “strikethrough” class is used to encapsulate the text that should have a strikethrough effect. The CSS style rule with the text-decoration property set to “line-through” applies the strikethrough effect to any element with the “strikethrough” class.

Using CSS to apply the strikethrough effect offers more flexibility and control over the appearance of the text. It also separates the styling from the content, making it easier to manage and maintain the code.

It’s important to note that the <strike> tag may still work in some browsers for backward compatibility, but its usage is not recommended according to current HTML standards.

YOU MAY ALSO LIKE...

The Tech Thunder

The Tech Thunder

The Tech Thunder


COMMENTS