Marquees

Sometimes you might want your text or photos to continuously "scroll" across the screen. Or maybe you'd like it to zoom in from the side, then stay there. Or perhaps you'd like it to bounce back and forth across the screen. All these things are possible using marquees.

There are two main methods for creating marquees (without using JavaScript). These are:

In the above example, everything between the <marquee></marquee> tags scrolls across the page. You could also make the text bounce, slide—in, or you could even make a scrolling image.

CSS Animations

You can also use CSS animations to create a marquee. In fact, this is the recommended option. CSS animations are being included in the official CSS specifications (from CSS3) and it's expected that this will be the default method for creating marquees in the future.

Here's an example of using CSS animations to create the same effect as the above example.

HTML Marquees vs CSS Marquees

CSS animations are the recommended option for creating marquees. This is because animations are being included in the official CSS specifications, whereas the HTML <marquee> element was never in the official HTML specifications (it is a non-standard element).

While HTML marquees are easier to code, they don't provide the range of possibilities that CSS animations do. Also, browser support for the <marquee> element is likely to be phased out in favor of CSS animations.