html 5 marquee tag error in w3c validation

lifeline picture lifeline · Feb 28, 2013 · Viewed 17.3k times · Source

I have some text in marquee tag.

<marquee direction="left" scrollamount="4">
 Test Test Test Test Test
</marquee>

I am using html 5 and css 3. When i check my html in w3c validator, it shows the following error.

 Element marquee not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

        <marquee direction="left" scrollamount="4"> 

How to fix this?

Answer

Yukul&#233;l&#233; picture Yukulélé · Feb 28, 2013

Marquee tag is not html5 (is not html at all, but Microsoft proprietary tag from 1995)

you can :

  • use javascript to animate your text
  • use css animation (not fully browser compatible)
  • use css3 marquee (not fully browser compatible)
  • use marquee and ignore W3C warning (marquee is full browser compatible, even in iOS safari!)
  • don't use marquee effect (it's ugly)

Be careful with W3C validator, it is not always know all W3C specifications !