Reputation: 684
I have a span containing a number that will increment as time passes. However, I would like it to expand to the left, instead of the right as it gain another digit (i.e. from 9 to 10). How can I do that within a span?
Upvotes: 0
Views: 2574
Reputation: 1314
You can use the CSS direction attribute, together with a difined width and display block:
span {
width: 300px;
display: block;
direction: rtl;
background-color: #ff0000;
color: #fff;
}
<span> RIGHT TO LEFT</span>
http://www.w3schools.com/cssref/pr_text_direction.asp
Upvotes: 5