This page contains marquee codes. Feel free to copy and paste the marquee codes into your own website, blog, MySpace page, or other HTML document. And feel free to modify the code as you wish.
Continuous Scrolling 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.
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
This HTML marquee is scrolling horizontally from right to left. Although this tends to be the default, you can specify
direction="left" in the HTML code. You can also set it to
down (see below).
Vertical Marquee Code
Here, the text scrolls upward. This is acheived by using both
direction="up". You could change this to
direction="down" if you prefer.
Slide-in Marquee Code
This example sets the text to slide in, and then stay there. It doesn't loop continuously like the above examples. It simply slides in, then stops. This is acheived by using
Tip: If you don't see the text sliding in here, refresh the page - the text probably slid in before you noticed it!
Bouncing Marquee Code
Here, the text bounces back and forth. This is acheived by using
You can speed up or slow down your marquees by using the
scrollamount attribute along with a numeric value. Here, we use several values to set different marquees speed.
You can also make images scroll. To do this, simply add image code within the
marquee tag instead of text. Here, we add an animated gif - one which suits the scrolling motion of the marquee.
Images and Text
There's nothing to stop you putting more than one HTML element inside your HTML marquee codes. Doing so will make both scroll.
<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:
|Sets the width of the marquee||How far to jump as it moves|
|Sets the height of the marquee||How many times it should loop|
|Sets the direction of the marquee||Sets the background color of the marquee|
|Whether to slide, bounce, or scroll||Sets the amount of horizontal space around the marquee|
|How long the marquee should wait before each jump||Sets the amount of vertical space around the marquee|