I can't see how to fix the span width so it doesn't wobble:
<!DOCTYPE html>
<html>
<script>
function go() {
x='this message will self-destruct in five seconds.......';
xl=x.length;
x+=x;
n=0;
setInterval('ticker.textContent=x.slice(n++,n+10);if (n>xl-10) n=0;',100);
}
</script>
<body onload='go();'>
<span style='background-color:red;width:100pt' id='ticker'></span>
</body>
</html>
A link to JSFiddle.
display as "block":
the
span
element is aninline
element, this means itswidth
andheight
are controlled by the content, you need to use eitherdisplay:inline-block
ordisplay:block
depending on the wanted interaction with other elements.You can wrap it in a containing div also and apply the styling to the div..
http://jsfiddle.net/w9ccq96x/1/