change language in blog

Friday, February 10, 2012

How to Make a Scrolling Marquee in HTML

Ever seen a cool, scrolling text on a website? Do you know how these are made? If not, this article is for you. You can make a marquee any color, scroll any direction, and more.

Steps

  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.

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.
Warnings
  • The <marquee> element is deprecated, which means that is is not correct HTML, and it should not really be used. Pages will not validate if they include this tag, and it may cause problems with some browsers.
  • Too much animation can be distracting! It also looks unprofessional and forces a visitor to wait for your content to appear (i.e., your visitor will leave and you will lose the sale). Websites that use marquees make it onto lists such as "Web Pages that Suck".
 source by wikihow

No comments:

Post a Comment

Total Pageviews