<p>Those of you who have been writing <a href="https://www.lifewire.com/learn-basic-html-for-beginners-web-sites-2652426" data-component="link" data-source="inlineLink" data-type="externalLink" data-ordinal="1" rel="nofollow">HTML</a> for a long time may remember the element. This was a browser-specific element that created a banner of scrolling text across the screen. This element was never added to the <a data-inlink="eQpuHwNR_-k2e-WC42amLA&#61;&#61;" href="https://www.thoughtco.com/what-you-can-do-with-html-3466578" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="2">HTML specification</a> and support for it varied widely across browsers. People often had very strong opinions about the use of this element — both positive and negative. But whether you loved or hated it, it did serve the purpose of making content that overflowed the box boundaries visible.</p><p>Part of the reason it was never fully implemented by browsers, aside from strong personal opinion, was that it is considered a visual effect and as such, it shouldn’t be defined by the HTML, which defines the structure. Instead, visual or presentation effects should be managed by CSS. And CSS3 adds the marquee module to control how browsers add <a data-inlink="ei_KgD8cwHzGD47Rc3k8bw&#61;&#61;" href="https://www.thoughtco.com/marquee-element-3468283" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="3">the marquee effect</a> to elements.</p><h3>New CSS3 Properties</h3><p>CSS3 adds five <a data-inlink="QEIzwhbYc7niLl_vFhg2MQ&#61;&#61;" href="https://www.thoughtco.com/property-definition-3466899" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="4">new properties</a> to help control how your content displays in the marquee: <code>overflow-style</code>, <code>marquee-style</code>, <code>marquee-play-count</code>, <code>marquee-direction</code> and <code>marquee-speed</code>.</p><p><strong><code>overflow-style</code></strong><br/>The <code>overflow-style</code> property (which I also discussed in the article CSS Overflow) defines the preferred style for contents that overflows the content box. If you set the value to <code>marquee-line</code> or <code>marquee-block</code> your content will slide in and out to the left/right (<code>marquee-line</code>) or up/down (<code>marquee-block</code>).</p><p><strong><code>marquee-style</code></strong><br/>This property defines how the content will move into view (and out). The options are <code>scroll</code>, <code>slide</code> and <code>alternate</code>. Scroll starts with the content completely off screen, and then it moves across the visible area until it is all completely off screen again. Slide starts with the content completely off screen and then it moves across until the content has fully moved onto the screen and there is no more content left to slide on the screen. Lastly, alternate bounces the content from side to side, sliding back and forth.</p><p><strong><code>marquee-play-count</code></strong><br/>One of the drawbacks of using the <code>MARQUEE</code> element is that the marquee never stops. But with the style property <code>marquee-play-count</code> you can set the marquee to rotate the content on and off for a specific number of times.</p><p><strong><code>marquee-direction</code></strong><br/>You can also choose the direction that the content should scroll on the screen. The values <code>forward</code> and <code>reverse</code> are based on the directionality of the text when the <code>overflow-style</code> is <code>marquee-line</code> and up or down when the <code>overflow-style</code> is <code>marquee-block</code>.</p><h3>Marquee-Direction Details</h3><table border="1" cellpadding="2" cellspacing="0"><tbody><tr><th><code>overflow-style</code></th><th>Language Direction</th><th>forward</th><th>reverse</th></tr><tr><th><code>marquee-line</code></th><td>ltr</td><td>left</td><td>right</td></tr><tr><td> </td><td>rtl</td><td>right</td><td>left</td></tr><tr><th><code>marquee-block</code></th><td> </td><td>up</td><td>down</td></tr></tbody></table><p><strong><code>marquee-speed</code></strong><br/>This property determines how quickly the content scrolls on the screen. The values are <code>slow</code>, <code>normal</code>, and <code>fast</code>. The actual speed depends upon the content and the browser displaying it, but the values must be <code>slow</code> is slower than <code>normal</code> which is slower than <code>fast</code>.</p><h3>Browser Support of the Marquee Properties</h3><p>You may need to use <a href="https://www.thoughtco.com/css-vendor-prefixes-3466867" data-component="link" data-source="inlineLink" data-type="internalLink" data-ordinal="5">vendor prefixes</a> to get the CSS marquee elements to work. They are as follows:</p><table border="0" cellpadding="2" cellspacing="0"><tbody><tr><th>CSS3</th><th>Vendor Prefix</th></tr><tr><td><code>overflow-x: marquee-line;</code></td><td><code>overflow-x: -webkit-marquee;</code></td></tr><tr><td><code>marquee-style</code></td><td><code>-webkit-marquee-style</code></td></tr><tr><td><code>marquee-play-count</code></td><td><code>-webkit-marquee-repetition</code></td></tr><tr><td><code>marquee-direction: forward|reverse;</code></td><td><code>-webkit-marquee-direction: forwards|backwards;</code></td></tr><tr><td><code>marquee-speed</code></td><td><code>-webkit-marquee-speed</code></td></tr><tr><td>no equivalent</td><td><code>-webkit-marquee-increment</code></td></tr></tbody></table><p>The last property allows you to define how large or small the steps should be as the content scrolls on screen in the marquee.</p><p>In order to have your marquee working, you should place the vendor prefixed values first and then follow them with the CSS3 specification values. For example, here is the CSS for a marquee that scrolls the text five times from left to right inside a 200x50 box.</p><blockquote><code>{<br/> width: 200px; height: 50px; white-space: nowrap;<br/> overflow: hidden;<br/> overflow-x:-webkit-marquee;<br/> -webkit-marquee-direction: forwards;<br/> -webkit-marquee-style: scroll;<br/> -webkit-marquee-speed: normal;<br/> -webkit-marquee-increment: small;<br/> -webkit-marquee-repetition: 5;<br/> overflow-x: marquee-line;<br/> marquee-direction: forward;<br/> marquee-style: scroll;<br/> marquee-speed: normal;<br/> marquee-play-count: 5;<br/>} </code></blockquote>