<marquee> Element

Renders as scrolling text, either horizontally or vertically.


Attribute Description Value
width How wide the marquee is 10, 20%
height How high the marquee is 10, 20%
direction Which direction it should scroll up, down, left, right
behaviour Type of scrolling scroll, slide, alternate
scrolldelay Delay between each scroll frame 10, 20, etc in milliseconds
scrollamount Sets the speed of scrolling 10, 20, etc in milliseconds
loop How many times to loop default is infinite
bgcolor background colour colour name or hex value
hspace Horizontal space around the marquee 10, 20%
vspace Vertical space around the marquee 10, 20%


<!DOCTYPE html>
		<title>My Document Title</title>
		<marquee>This is basic example of marquee</marquee>
		<marquee width="50%">This example will take only 50% width</marquee>
		<marquee direction="right">This text will scroll from left to right</marquee>
		<marquee direction="up">This text will scroll from bottom to top</marquee>
		<marquee direction="down">This text will scroll from top to bottom</marquee>



An image can also be placed within a marquee to provide some basic animation, this example increases the speed of the scrolling to give a slightly smoother scroll:


<marquee scrollamount="50"><img src="HTML5_logo.png"></marquee>

Leave a Reply