Thursday, April 21, 2011

CSS3 vs. Marquee tag

A year ago, I started to use Microsoft's "marquee" tag in games (bad idea). The marquee element moves anything that you put inside it. For example, you could put the text "Hello world!" into the marquee and use attributes to make it go up and down, bounce back and forth, and do other things. Even some other browsers support it. Problem is, it isn't really a W3C standard. W3Schools doesn't even teach you the marquee tag. So what?

You can use JavaScript and CSS combined to animate an element. But even easier is the new CSS3 animation property. CSS3 is rather great but inconvenient right now, because most browsers require a prefix before most of CSS3's properties. For example, the CSS3 property "transform" needs -webkit-transform for Webkit browsers (Chrome and Safari), -moz-transform for Firefox, and -o-transform for Opera. Nothing for IE (as it doesn't support it yet, at least not in IE8 or below). And no support for the transform property itself.

But I still think that CSS3 is better than the marquee element for animation, as it has more advantages. And CSS3 might eventually replace animated GIF files, and even Flash. Because CSS3 can work for advertisements.

2 comments:

  1. CSS3's approach seems much better. Thanks for the tip

    ReplyDelete
  2. Heh you're welcome. Did you ever use the marquee element?

    ReplyDelete

Please keep your comments appropriate.