<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>CSS3 Marquee</title>
</head>
<body>
<h1>CSS3 Marquee</h1>
<p>Warning: Firefox only, as it's the only browser that supports <a href="https://developer.mozilla.org/en-US/docs/CSS/element"><code>element()</code> as a value for the background property</a></p>
<h2>Marquee: alternate</h2>
<div class="marquee short alternate"></div>
<div class="marquee long alternate"></div>
<h2>Marquee: slide</h2>
<div class="marquee short slide"></div>
<div class="marquee long slide"></div>
<h2>Marquee: left</h2>
<div class="marquee short left"></div>
<div class="marquee long left"></div>
<h2>Marquee: right</h2>
<div class="marquee short right"></div>
<div class="marquee long right"></div>
<h2>Marquee: down</h2>
<div class="marquee short down"></div>
<div class="marquee long down"></div>
<h2>Marquee: up</h2>
<div class="marquee short up"></div>
<div class="marquee long up"></div>
<div style="overflow:hidden; height:0; width: 0; top: 100px;">
<span id="marqueeshort">Lorem ipsum</span>
<span id="marqueelong">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elementum velit at odio condimentum in dictum sapien dapibus.</span>
</div>
<h1>FAQ</h1>
<h2>Why not just change the left/right position?</h2>
<p>Because when you use <code>left: -100%;</code> (or <code>transform: translateX(-100%);</code>) that <code>100%</code> accounts for the width of the container (here <code>12em</code>) and not the width of the content.</p>
<p>If you'd have a marquee where the text is longer than the width of the containing element, it'd fail. Here's an example with the marquee set to <code>transform: translateX(-100%);</code>:</p>
<div class="faqwrapper"><div class="marquee faq faq1">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In elementum velit at odio condimentum in dictum sapien dapibus.</div></div>
...