HTML Marquee
The <marquee>
tag is used to create scrolling text or images horizontally or vertically. It was introduced in early web development but is now obsolete and not recommended for use in modern websites.
Basic Example
<marquee>This is scrolling text</marquee>
Attributes
The <marquee>
tag supports various attributes:
- direction: scroll direction (
left
,right
,up
,down
) - behavior: scroll type (
scroll
,slide
,alternate
) - scrollamount: speed of the marquee
- loop: how many times it loops
Example with Attributes
<marquee direction="right" behavior="alternate" scrollamount="10">
Bouncing Text
</marquee>
Warning
Note: The <marquee>
tag is not part of the HTML standard and has been deprecated. For modern and accessible designs, use CSS animations instead.
CSS Alternative
<div class="scroll-text">Scrolling with CSS</div>
<style>
.scroll-text {
width: 100%;
white-space: nowrap;
overflow: hidden;
animation: scroll 10s linear infinite;
}
@keyframes scroll {
0% { transform: translateX(100%); }
100% { transform: translateX(-100%); }
}
</style>