wahle509
wahle509

Reputation: 684

How to make text grow to the left in a span?

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

Answers (1)

RafaelTSCS
RafaelTSCS

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

Related Questions