Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

HTML strike Tag

Posted in HTML Tutorial
Updated on Feb 12, 2024
By Mari Selvan
👁️ 32 - Views
⏳ 4 mins
💬 1 Comment
HTML strike Tag

Photo Credit to CodeToFun

🙋 Introduction

In the world of HTML, the <strike> tag plays a crucial role in representing text that has been struck through or marked as no longer relevant.

This guide will provide you with a comprehensive understanding of the HTML <strike> tag and how to effectively use it in your web development projects.

🤔 What is <strike> Tag?

The <strike> tag is an HTML element used to denote text that has been struck through, indicating that it is no longer accurate or relevant. This visual representation can be useful in various scenarios, such as indicating deprecated information or crossed-out prices.

💡 Syntax

To implement the <strike> tag, wrap the text you want to strike through with the opening <strike> tag and the closing </strike> tag.

syntax.html
Copied
Copy To Clipboard
<strike>Your Struck Through Text Here</strike>

🧰 Attributes

The <strike> tag typically does not have specific attributes, but you can use global attributes like class and style for additional styling or linking to external CSS classes.

attributes.html
Copied
Copy To Clipboard
<strike class="deprecated" style="text-decoration: line-through; color: #999;">Deprecated Text</strike>

📚 Common Use Cases

  1. Deprecated Information:

    The primary use of the <strike> tag is to mark text as deprecated or outdated. This is common in documentation or when communicating changes in a web application.

    deprecated-information.html
    Copied
    Copy To Clipboard
    <strike>This feature has been deprecated and will be removed in the next release.</strike>
  2. Crossed-out Prices:

    In e-commerce websites, the <strike> tag can be used to display original prices that have been discounted.

    crossed-out-prices.html
    Copied
    Copy To Clipboard
    <p>
      Original Price: <strike>$99.99</strike> Discounted Price: $79.99
    </p>

🖥️ Browser Support

Understanding the compatibility of the <strike> tag across different browsers is essential for delivering a consistent user experience. Here's an overview of its support:

  • Google Chrome: Fully supported.
  • Mozilla Firefox: Fully supported.
  • Microsoft Edge: Fully supported.
  • Safari: Fully supported.
  • Opera: Fully supported.
  • Internet Explorer: Partial support (some versions may have limitations).

Ensure you test your code in various browsers to guarantee a seamless experience for your audience.

🏆 Best Practices

  • Use the <strike> tag judiciously to avoid confusion, ensuring that it genuinely represents information that is no longer valid.
  • Consider combining with other tags like <del> for semantic clarity.

🎉 Conclusion

Mastering the use of the <strike> tag allows you to communicate changes effectively and enhance the presentation of your content. By implementing this tag thoughtfully, you can provide a clear visual indication of deprecated or irrelevant information.

👨‍💻 Join our Community:

To get interesting news and instant updates on Front-End, Back-End, CMS and other Frameworks. Please Join the Telegram Channel:

Author

author
👋 Hey, I'm Mari Selvan

For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.

Buy me a coffee to make codetofun.com free for everyone.

Buy me a Coffee

Share Your Findings to All

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Mari Selvan
Mari Selvan
3 months ago

If you have any doubts regarding this article (HTML strike Tag), please comment here. I will help you immediately.

We make use of cookies to improve our user experience. By using this website, you agree with our Cookies Policy
AgreeCookie Policy