Marquee element

Short description: HTML element for scrolling text

Template:Floated box

HTML

* Dynamic HTML
* HTML5
* audio
* canvas
* video
* XHTML
* Basic
* Mobile Profile
* C-HTML
* HTML element
* span and div
* HTML attribute
* HTML frame
* HTML editor
* Character encodings
* Unicode
* Language code
* Document Object Model
* Browser Object Model
* Style sheets
* CSS
* Font family
* Web colors
* HTML scripting
* JavaScript
* WebGL
* WebCL
* W3C
* Validator
* WHATWG
* Quirks mode
* Web storage
* Rendering engine

Comparisons

* Document markup languages
* HTML support
* XHTML
* 1.1

The marquee tag is a non-standard HTML element which causes text to scroll up, down, left or right automatically. The tag was first introduced in early versions of Microsoft's Internet Explorer, and was compared to Netscape's blink element, as a proprietary non-standard extension to the HTML standard with usability problems. The W3C advises against its use in HTML documents.

## Contents

* 1 Usability problems
* 2 Attributes
* 3 Implementation
* 4 Compliance
* 5 References

## Usability problems

Marquee can be distracting[1] because the human eye is attracted to movement,[2] and marquee text is constantly moving.

As with the blink element, marquee-tagged images or text are not always completely visible on rendered pages, making printing such pages an inefficient (if not impossible) task; typically multiple attempts are required to capture all text that could be displayed where messages scroll or blink. The `behavior="alternate"` version of marquee makes text jitter back and forth but does not obscure any part of it if scrolling widths are set correctly.

Because marquee text moves, links within it are more difficult to click than those in static text, depending on the speed and length of the scrolling. Users only get one chance every time it scrolls past. Also, scrolling text too fast can make it unreadable to some people, particularly those with visual impairments. This can easily frustrate users. To combat this, client-side scripting allows marquees to be programmed to stop when the mouse is over them.

## Attributes

Unlike its blinking counterpart, the marquee element has several attributes that can be used to control and adjust the appearance of the marquee.

`align`
Uses the same syntax as the img element.
`behavior`
Allows the user to set the behavior of the marquee to one of three different types:

* Scroll (default) – Scrolls the text from right-to-left, and restarts at the right side of the marquee when it has reached the left side. Text disappears when looping finishes.
* Slide – When used in absence of the "Behavior" attribute, contents to be scrolled will slide the entire length of marquee but stops the moment it hits the end, so that the contents will be displayed. But if it is used with attribute "Behavior" then the attribute "Slide" will be ignored.
* Alternate \- Scrolls the text from right-to-left & goes back left-to-right.

Loops are counted by each time it reaches each end of the marquee; a loop of 1 is different from "Slide" attribute. when item is being scrolled with "Slide" attribute, item will stop permanently at the end of length of the marquee, displaying the entire item. However, when an item is being scrolled without a "Loop" attribute, the number of scrolls will be repeated according to what number "Loop" is equal to. If "Loop=1" then item will scroll only once and will exit the length of marquee completely, while the item being scrolled will stop would be the same as "Slide". By default, "Loop=infinite" so it is not needed to code the attribute "Loop" if you want a non-stop scroll. Note: "Loop" will be ignored if attribute "Behavior" is coded. Also, if "Behavior=Alternate" and "Loop=2" then item will go from beginning of the Marquee to the end and back to the beginning, counting a round trip as 2 loops.
`bgcolor`
Sets the background color of the marquee.
`direction`
Sets the direction of the marquee box. Values are left, right, up, down where the value indicates the direction of travel. `direction=left` therefore moves the text from right to left on the screen.
`width`
This sets how wide the marquee should be.
`loop`
This sets how many times the marquee should "Loop" its text. Each trip counts as one loop.
`scrollamount`
This is how many pixels the text moves between "frames". So scrollamount=1 gives the slowest scroll speed.
`scrolldelay`
This sets the amount of time, in milliseconds, between "frames", much like watching a replay of a video where every frame of the video would be paused for x number of milliseconds. "Scrolldelay=1000" means a slow motion where every frame lasts one thousand milliseconds or one second.

A marquee element can contain arbitrary HTML, so in addition to text it could move one or more images, movie clips, or animated GIFs.

## Implementation

The marquee tag has been deprecated in most browsers, but the same behavior can still be implemented with Cascading Style Sheets, like this:

@keyframes marquee {
0% {
transform: translateX(100%);

100% {
transform: translateX(-100%);

.marquee-container {
white-space: nowrap;
overflow: hidden;
position: relative;
animation: marquee 10s linear infinite;

.marquee-content {
display: inline-block;

The animation, `marquee`, is defined by its `@keyframes` to be a simple translation from right to left; it would be possible to reverse the animation by inverting it (from -100% to 100%, for example). The `10s` can also be modified to alter its output.

The style can then be invoked in HTML:

<div class="marquee-container"><div class="marquee-content">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div></div>

Template:Floated box

## Compliance

The marquee element was first invented for Microsoft's Internet Explorer and is supported by it. Netscape has stipulated removal of the `<marquee>` element from the Internet Explorer during an HTML ERB meeting in February 1996, as a condition to removing the `<blink>` element from the Netscape.[3]

Firefox, Chrome and Safari web browsers support it for compatibility with legacy pages. The element is non-compliant HTML. CSS properties were proposed to achieve the same effect as specified in the Marquee Module Level 3, which was abandoned without implementation in 2014.[4] Similar effects can also be achieved through the use of JavaScript,[5] or CSS3 animations.[6]

## References

1. ↑ "Glossary » marquee". Usability First. Foraker. https://www.usabilityfirst.com/glossary/marquee/. Retrieved 2010-03-14.
2. ↑ Tim Louis Macaluso (2009-05-27). "Study shows that eyes will forsake words for movement". Rochester City Newspaper. Archived from the original on 2009-06-01. https://web.archive.org/web/20090601183515/http://www.rochestercitynewspaper.com/news/articles/2009/05/ADVERTISING-Study-shows-that-eyes-will-forsake-words-for-movement/. Retrieved 2010-03-14.
3. ↑ Raggett, Dave; Lam, Jenny; Alexander, Ian; Kmiec, Michael (1998). "Chapter 2 - A history of HTML". World Wide Web Consortium. https://www.w3.org/People/Raggett/book4/ch02.html. "The BLINK tag was ousted in an HTML ERB meeting. Netscape would only abolish it if Microsoft agreed to get rid of MARQUEE; the deal was struck and both tags disappeared."
4. ↑ CSS Marquee Module Level 3
5. ↑ Sharp, Remy (10 September 2008). "The Silky Smooth Marquee". https://remysharp.com/2008/09/10/the-silky-smooth-marquee/. Retrieved 20 July 2005.
6. ↑ liMarquee - alternative marquee jQuery plugin. Creates horizontal or vertical marquee for text, images, goods, banners or logos

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Marquee element. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Marquee_element&oldid=4230464"