Sunday, 8 April 2012

How to Make a Scrolling Marquee in HTML

  1. Open your HTML document, if you haven't already.


  2. Where you want your marquee to be, place this code:

    <marquee style="background-color: #000080;" direction="right" loop="20" width="75%">
    This is a scrolling marquee
    </marquee>
    
    • The style attribute controls the background color for the marquee. Leave the tag out if you don't want one. You should use either a color name, a hexadecimal (hex) value, or a RGB (Red Green Blue) value. A full list of colors and their values can be found here.
    • The style attribute inside the <div> tag controls the color of the text. See this list for colors.
    • Change the direction attribute to any direction you want out of the following: right, left, up or down.
    • The loop attribute can be changed to suit your needs - it controls how many times the marquee should loop. If you want it to run continuously, you can leave out this attribute.
    • The text inside the <marquee> tag and the </marquee> tag is the bit you need to change to put your text in.


Edit Tips

  • Marquees tend to be a little annoying on websites.
  • Be careful when you change the attributes on your marquee.
  • For a more complete definition of the <marquee> tag, take a look here.

No comments:

Post a Comment