Stella Lie
Stella Lie

Reputation: 124

Marquee : element vs. javascript

I was wondering what is the advantages and disadvantages to use HTML tag as opposed to achieving the same scrolling text effect using Javascript?

Is the use of <marquee> HTML tag encouraged?

Upvotes: 1

Views: 1770

Answers (2)

Denys S&#233;guret
Denys S&#233;guret

Reputation: 382194

You ask

Is the use of <marquee> HTML tag encouraged?

The w3.org answers :

No, really. don't use it.

You have no guarantee of marquee element support across future browsers and even when it's present, some of its options might be absent in today's browsers (for example I tested MDN's examples in Chrome and I got a different bouncing effect than in Firefox).

Most users would prefer not to see any JavaScript based solution either, but if you really need it (like, your boss asks for it), then a search of "JavaScript marquee" gives many solutions, for example

Very Simple, Very Smooth, JavaScript Marquee

JavaScript based solutions have the advantages of being configurable and of not being based on a non standard element ("HTML5 classifies it as a non-conforming feature.").

Upvotes: 8

Yukul&#233;l&#233;
Yukul&#233;l&#233;

Reputation: 17082

  • Marquee is Microsoft 1990's technology
  • Marquee was/is/will never be a w3c standard
  • Marquee is very ugly,

but

ALL browsers support it (even IOS safari!)

then

if you are sure you want this very ugly think on your website, use it.

eventual future non supporting browsers simply fallback to simple static style.

Upvotes: 2

Related Questions