最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - Marquee : element vs. javascript - Stack Overflow

programmeradmin1浏览0评论

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?

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?

Share Improve this question edited May 14, 2013 at 13:02 Denys Séguret 383k90 gold badges811 silver badges776 bronze badges asked May 14, 2013 at 12:43 Stella LieStella Lie 1241 gold badge4 silver badges14 bronze badges 3
  • 3 marquee, my oh my oh my divshot.github.io/geo-bootstrap – NimChimpsky Commented May 14, 2013 at 12:44
  • I, for one, wele our underconstruction.gif animated overlords. – Jeff Watkins Commented May 14, 2013 at 12:45
  • Have a look at developer.mozilla/en-US/docs/Web/HTML/Element/marquee. – Felix Kling Commented May 14, 2013 at 12:45
Add a ment  | 

2 Answers 2

Reset to default 8

You ask

Is the use of <marquee> HTML tag encouraged?

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

  • 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.

发布评论

评论列表(0)

  1. 暂无评论