Friday, 30 November 2012

Marquee Tag Material


HTML is a static language, marquees can add a certain buzz to a webpage.
This tutorial focuses on:
  • What is a marquee?
  • The <marquee> tag
  • When to use marquees

What is a marquee?

A marquee is a set of text that scrolls across a webpage. You can make marquees scroll vertically, horizontally, as well as alternating back and forth.

The <marquee> tag

The <marquee> tag is perhaps one of the most intricate tags in HTML, and rightfully so. While HTML is a static language, the <marquee> tag gives it some movement - literally! This tag creates a moving scroll which travels across a page.
NOTE: The <marquee> tag is not an official part of the HTML tag set, but it is still supported by some major browsers such as Internet Explorer and Firefox.
NOTE: Marquees are not very popular on the web, and their usage is generally not regarded positively. However, it is ok to use a marquee here and there once in a while.
<marquee> tag attributes
  • bgcolor - Denotes the background color of the marquee.
  • loop - Denotes how many times the marquee will scroll across the page. The value for this attribute can be a number used to denote how many times it should scroll or the value "infinite" denoting that the marquee should scroll forever.
  • height - This attribute takes a numerical value which denotes the height of the marquee.
  • width - This attribute takes a numerical value which denotes the width of the marquee.
  • direction - This attribute takes the value of either "left", "right", "up", or "down" to denote which way the marquee will scroll.
  • behavior - This attribute takes the value of either "scroll", "slide", or "alternate" to denote how the marquee will move. The value of "scroll" will make the marquee move one way continuously and is the default movement method of the marquee. The value of "slide" will make the marquee come in and stop. The value of "alternate" will make the marquee come in from both sides interchangeably.
Example:
<marquee bgcolor="yellow" loop="infinite" direction="up" height="100" width="400" > Hello, I am a scrolling marquee. Watch me scroll. </marquee>
Output:
Hello, I am a scrolling marquee. Watch me scroll.
Example 2:
<marquee bgcolor="#e7ffe0" loop="infinite" height="80" width="450" behavior="alternate"> This marquee scrolls in alternate directions. </marquee>
Output:
This marquee scrolls in alternate directions.

When to use marquees

As stated above, marquees should be used rarely. Using marquees will set an impression on your audience. But it all depends on who that audience is. If your general audience are average web users, then they will probably like the marquee and think its 'cool'. If however, your general audience are people who know a thing or two about web development, they may think your skills are outdated and it will make you look much less professional.
It is ok to use marquees once in a while (and really, just once in a while) to add a nice scrolling effect. But don't ever make a habit out of it. Even if your general audience is average web users who don't know anything about web development. Keep in mind that it is important not just how a webpage looks, but how it functions. And using the <marquee> tag will actually result in webpages that do not validate with an HTML validator.

No comments:

Post a Comment