title: CSS animate a div with absolute positioning from left 0 to right 0
body: <p>Consider this sample.</p>
  
  <p><a href="http://jsfiddle.net/dfabulich/ncbzz5zu/3/" rel="noreferrer">http://jsfiddle.net/dfabulich/ncbzz5zu/3/</a></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;style&gt;
  .container {
      position: relative;
      width: 80%;
      height: 100px;
      border: 1px solid black;
  }
  
  @keyframes slide {
    from { background-color: red; left: 0; }
    to { background-color: blue; right: 0; }
  }
  
  .animated {
      position: absolute;
      width: 20%;
      height: 100%;
      top: 0;
      background-color: red;
      animation-duration: 3s;
      animation-name: slide;
      animation-iteration-count: infinite;
  }
  
  &lt;/style&gt;
  &lt;div class=container&gt;
  &lt;div class=animated&gt;
  &lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Expected: The red rectangle should smoothly animate from left to right as the color changes from red to blue.</p>
  
  <p>Actual: In Chrome/Firefox, the red rectangle slowly changes color to purple, then teleports from left to right without animating, and then slowly changes from purple to blue. In Safari, the rectangle appears on the right and never moves from there, while animating from red to blue.</p>
  
  <p>Why is this happening? How can I fix it? (I need to fix it in CSS… no JS, no jQuery.)</p>