Marquee text is an older HTML effect where the text is scrolled horizontally, or vertically, across the page. Marquee text is used to draw attention with banners, news tickers, and announcements on older websites. Although the <marquee> tag has been deprecated in HTML5 and no longer is the best practice, it remains to work across most modern browsers and can even provide an entertaining or nostalgic means to introduce movement to your page. When you're creating your personal blog, retro-themed page, or simply testing out HTML, marquee text remains useful for basic effects without using JavaScript or CSS animations. Here are some examples illustrating the use of the <marquee> tag with various options such as the direction, width, and the background color. Both the HTML code and the live result are given for each.
Example 1: Basic Marquee
<marquee>ADD YOUR TEXT HERE...</marquee>
Result:
Example 2: Scroll to the Right
<marquee direction="right">ADD YOUR TEXT HERE...</marquee>
Result:
Example 3: Scroll to the Left
<marquee direction="left">ADD YOUR TEXT HERE...</marquee>
Result:
Example 4: Full Width, Background Color
<marquee direction="right" width="100%" style="background:#EC4F52;"> <span style="color:white;">ADD YOUR TEXT HERE...</span> </marquee>
Result:
Example 5: Left Scroll, Colored Background
<marquee direction="left" width="100%" style="background:#EC4F52;"> <span style="color:white;">ADD YOUR TEXT HERE...</span> </marquee>
Result:
⚠️ Note:
The <marquee> element is outdated and should not be used anymore on modern sites. Instead, use CSS animations or JavaScript to have more control, better performance, and improved accessibility. Nevertheless, it may still be used cautiously for small projects or retro designs.
where do you place this code? you have not mentioned ...