Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

HTML s Tag

Posted in HTML Tutorial
Updated on Oct 30, 2024
By Mari Selvan
👁️ 84 - Views
⏳ 4 mins
💬 1 Comment
HTML s Tag

Photo Credit to CodeToFun

🙋 Introduction

In the realm of HTML, the <s> tag plays a crucial role in indicating text that is no longer accurate or relevant.

This guide will provide insights into the purpose and proper implementation of the HTML <s> tag.

🤔 What is <s> Tag?

The <s> tag is a semantic HTML element used to represent text that is no longer accurate or relevant. It is often employed to denote content that has been "struck through," visually indicating to users that the information is outdated or no longer valid.

💡 Syntax

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

syntax.html
Copied
Copy To Clipboard
<s>Outdated Information</s>

🧰 Attributes

The <s> tag does not have specific attributes. However, it can be combined with other elements or styled using CSS for a more customized appearance.

attributes.html
Copied
Copy To Clipboard
<s style="color: red;">Deprecated Feature</s>

📚 Common Use Cases

  1. Strikethrough Text:

    The primary purpose of the <s> tag is to visually strike through text that is no longer accurate or relevant.

    strikethrough-text.html
    Copied
    Copy To Clipboard
    <p>The <s>old price</s> new price is $19.99.</p>
  2. Documenting Changes:

    It is often used in conjunction with the <ins> tag to highlight additions and deletions within a document.

    documenting-changes.html
    Copied
    Copy To Clipboard
    <p><ins>New content</ins> <s>Old content</s></p>

🖥️ Browser Support

Understanding the compatibility of the <s> 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 <s> tag to clearly indicate outdated or irrelevant information.
  • Combine with other tags like <ins> for comprehensive documentation of changes.
  • Apply appropriate CSS styles for a visually consistent presentation.

🎉 Conclusion

Effectively using the <s> tag is valuable for web developers looking to convey changes or mark outdated information. By implementing this tag judiciously, you can enhance the clarity of your content and provide a better user experience.

👨‍💻 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
8 months ago

If you have any doubts regarding this article (HTML s 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