title: How can I create a marquee effect?
body: <p>I'm creating a marquee effect with CSS3 animation.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#caption {
      position: fixed;
      bottom: 0;
      left: 0;
      font-size: 20px;
      line-height: 30px;
      height:30px;
      width: 100%;
      white-space: nowrap;
      -moz-animation:  caption 50s linear 0s infinite;
      -webkit-animation:  caption 50s linear 0s infinite;
  }
  @-moz-keyframes caption { 
      0% { margin-left:120%; } 100% { margin-left:-4200px; }  
  }
  @-webkit-keyframes caption { 
      0% { margin-left:120%; } 100% { margin-left:-4200px; }  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="caption"&gt;
      The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog.
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now I can get the basic marquee effect, but the code is too specific for this demo.</p>
  
  <p>Is there a way to avoid using specific values like <code>margin-left:-4200px;</code>, so that it can adapt text in any length?</p>
  
  <p>Here is a similar demo: <a href="http://jsfiddle.net/jonathansampson/XxUXD/" rel="noreferrer">http://jsfiddle.net/jonathansampson/XxUXD/</a> that uses <code>text-indent</code> but still with specific values.</p>