1

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?

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
Stella Lie
  • 124
  • 1
  • 4
  • 14

2 Answers2

8

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.").

Community
  • 1
  • 1
Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
  • 2
    Isn't the reason that the UX effect is bad, meaning its javascript replacement isn't any better? – John Dvorak May 14 '13 at 12:46
  • why use a javascript version of marquee tag over the marquee, the point is not to use it at all, isn't it. – NimChimpsky May 14 '13 at 12:46
  • @JanDvorak I'd say that the most important for the w3.org isn't that the UX effect is bad but that it's very specific, that is the w3.org can't design all tuning and parameterization desirable features for such a rarely used effect. – Denys Séguret May 14 '13 at 12:51
  • 1
    heretic! `marquee` is the best element html was supposed to have, same as `blink`!!! – Christoph May 14 '13 at 12:52
  • @Christoph `` – John Dvorak May 14 '13 at 12:53
  • @JanDvorak Agree. The Client wants it, and I have no say. I wouldn't want it if it was for my own website - its definitely ugly. I was juggling whether to use the existing element or use Javascript. – Stella Lie May 15 '13 at 00:56
2
  • 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.

Yukulélé
  • 15,644
  • 10
  • 70
  • 94