Comment puis-je créer un effet de texte défilant?

Je suis de créer un effet de texte défilant avec CSS3 animation.

CSS:

#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; }  
}

HTML:

<div id="caption">
    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.
</div>

Je peux maintenant la base de marquise effet, mais le code est trop spécifique pour cette démo.

Est-il un moyen d'éviter d'utiliser des valeurs spécifiques comme margin-left:-4200px;, afin qu'il puisse adapter le texte dans n'importe quelle longueur?

Voici une semblable démonstration: http://jsfiddle.net/jonathansampson/XxUXD/ qui utilise text-indent mais toujours avec des valeurs spécifiques.

InformationsquelleAutor Fred Wu | 2014-01-20