Reputation: 124
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
Reputation: 382194
You ask
Is the use of
<marquee>
HTML tag encouraged?
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
Reputation: 17082
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