HTML Basic
HTML Reference
- HTML Tags
- <!--...-->
- <!DOCTYPE>
- <a>
- <abbr>
- <address>
- <area>
- <article>
- <aside>
- <audio>
- <b>
- <base>
- <bdi>
- <bdo>
- <blockquote>
- <body>
- <br>
- <button>
- <canvas>
- <caption>
- <cite>
- <code>
- <col>
- <colgroup>
- <data>
- <datalist>
- <dd>
- <del>
- <details>
- <dfn>
- <dialog>
- <div>
- <dl>
- <dt>
- <em>
- <embed>
- <fieldset>
- <figcaption>
- <figure>
- <footer>
- <form>
- <h1> to <h6>
- <head>
- <header>
- <hgroup>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <kbd>
- <label>
- <legend>
- <li>
- <link>
- <main>
- <map>
- <mark>
- <menu>
- <meta>
- <meter>
- <nav>
- <noscript>
- <object>
- <ol>
- <optgroup>
- <option>
- <output>
- <p>
- <param>
- <picture>
- <pre>
- <progress>
- <q>
- <rp>
- <rt>
- <ruby>
- <s>
- <samp>
- <script>
- <search>
- <section>
- <select>
- <small>
- <source>
- <span>
- <strong>
- <style>
- <sub>
- <summary>
- <sup>
- <svg>
- <table>
- <tbody>
- <td>
- <template>
- <textarea>
- <tfoot>
- <th>
- <thead>
- <time>
- <title>
- <tr>
- <track>
- <u>
- <ul>
- <var>
- <video>
- <wbr>
- HTML Deprecated Tags
- HTML Events
- HTML Global Attributes
- HTML Status Code
- HTML Language Code
- HTML Country Code
- HTML Charset
- MIME Types
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.
<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.
<s style="color: red;">Deprecated Feature</s>
📚 Common Use Cases
Strikethrough Text:
The primary purpose of the
<s>
tag is to visually strike through text that is no longer accurate or relevant.strikethrough-text.htmlCopied<p>The <s>old price</s> new price is $19.99.</p>
Documenting Changes:
It is often used in conjunction with the <ins> tag to highlight additions and deletions within a document.
documenting-changes.htmlCopied<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:
Author
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
If you have any doubts regarding this article (HTML s Tag), please comment here. I will help you immediately.