Marquees
In HTML, marquees are elements that allow other HTML elements to scroll across the page. Actually, marquees allow you to do much more than just scroll across the page. For example, you can create bouncing text, slide-in images, fast and/or slow marquees, and much more.
This page contains marquees. Feel free to copy and paste the marquees into your own website, blog, or other HTML document. And feel free to modify the code as you wish.
Basic Marquee Code
The following example demonstrates what the basic HTML marquee code does. The marquee
tag allows stuff (i.e. text, images, etc) to scroll across the page.
Using behavior="scroll"
sets the marquee to scroll continuously - that is, every time the text has scrolled all the way across, it starts again. It's basically in a loop. We set its direction using the direction
.
This HTML marquee is scrolling from right to left. Although this tends to be the default, you can specify direction="left"
in the HTML code.
Source Code | Result |
---|---|
There are plenty of other things you can do with HTML marquees - especially with a little creativity. Check out the marquee codes below to get marquee code for your website!
Marquee Attributes
The <marquee>
tag accepts a number of attributes (some of which are included in the above examples). Feel free to experiment with these settings to see the effect they have on your scrolling text. The full list of attributes are:
width | Sets the width of the marquee | scrollamount | How far to jump as it moves |
height | Sets the height of the marquee | loop | How many times it should loop |
direction | Sets the direction of the marquee | bgcolor | Sets the background color of the marquee |
behavior | Whether to slide, bounce, or scroll | hspace | Sets the amount of horizontal space around the marquee |
scrolldelay | How long the marquee should wait before each jump | vspace | Sets the amount of vertical space around the marquee |