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 marquee tag
Photo Credit to CodeToFun
🙋 Introduction
The <marquee>
tag in HTML is a classic element that allows you to create scrolling text or images within a web page. Despite its deprecated status in HTML5, understanding its usage can still be valuable for certain applications.
This guide will delve into the nuances of using the <marquee>
tag effectively.
🤔 What is <marquee> Tag?
The <marquee>
tag is an HTML element used to create scrolling text or images horizontally or vertically within a web page. It was widely used in the early days of the web for creating attention-grabbing effects.
🚫 Deprecated Status:
It's important to note that the <marquee>
tag is deprecated in HTML5 and no longer supported by major web browsers. Its usage is strongly discouraged due to accessibility concerns and user experience issues. Modern web standards advocate for more user-friendly and inclusive design practices.
💡 Syntax
To implement the <marquee>
tag, simply enclose the content you want to scroll within the opening and closing <marquee>
tags. You can customize the direction, behavior, and speed of the scrolling using attributes.
<marquee direction="left" behavior="scroll" scrollamount="3">Your Scrolling Content Here</marquee>
🧰 Attributes
The <marquee>
tag supports several attributes to control the scrolling behavior:
- direction: Specifies the direction of the scrolling motion (left, right, up, or down).
- behavior: Defines the scrolling behavior (scroll, slide, or alternate).
- scrollamount: Sets the speed of the scrolling.
- loop: Specifies the number of times the marquee should loop (use -1 for infinite looping).
📚 Common Use Cases
Scrolling Text:
The primary use case of the
<marquee>
tag is to create attention-grabbing scrolling text effects.index.htmlCopied<marquee behavior="scroll" direction="left">Welcome to Our Website!</marquee>
Scrolling Images:
You can also use the
<marquee>
tag to create scrolling images within your web page.index.htmlCopied<marquee behavior="scroll" direction="left"> <img src="image1.jpg" alt="Image 1"> <img src="image2.jpg" alt="Image 2"> <img src="image3.jpg" alt="Image 3"> </marquee>
🖥️ Browser Support
Although widely supported in older browsers, it's important to note that the <marquee>
tag is deprecated in HTML5 and may not be supported in future browser versions. Consider alternative approaches for achieving scrolling effects to ensure compatibility with modern web standards.
- Google Chrome: Partial support (some versions may have limitations).
- Mozilla Firefox: Partial support (some versions may have limitations).
- Microsoft Edge: Partial support (some versions may have limitations).
- Safari: Partial support (some versions may have limitations).
- Opera: Partial support (some versions may have limitations).
- 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
<marquee>
tag sparingly and consider alternative methods for achieving similar effects using CSS animations or JavaScript. - Avoid excessive or distracting use of scrolling content, as it can negatively impact user experience and accessibility.
🎉 Conclusion
While the <marquee>
tag remains a nostalgic element from the early days of the web, its usage is no longer recommended for modern web development practices.
However, understanding its implementation can still be valuable for certain scenarios, particularly for maintaining compatibility with legacy systems.
👨💻 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 marquee Tag), please comment here. I will help you immediately.