Mils
Mils

Reputation: 488

Reverse progressbar using CSS3

I have this EXAMPLE.

I want to reverse the progress bar 180 degree to progress from right to left. To obtain something like this :

enter image description here

I tried to change the transition attribute but no result.

Code :

.progress-bar span {
        display: inline-block;
        height: 100%;
        background-color: #777;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
        -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
        -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
        box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
        transition: width .4s ease-in-out;      
}

Upvotes: 4

Views: 6370

Answers (3)

Evhz
Evhz

Reputation: 9266

Having a <progress class="progress" /> html tag you could use:

.progress {
  direction: rtl;
}

Upvotes: 0

Zoltan Toth
Zoltan Toth

Reputation: 47677

Make the progress bar block and just float it to the right:

.progress-bar span {
    display: block;
    float: right;
    ...
}

DEMO

Upvotes: 7

Prinzhorn
Prinzhorn

Reputation: 22508

Make the span a block element and use margin-left. But you need to inverse the progress as well. E.g. 30% needs margin-left:70%;

http://jsfiddle.net/fmaGZ/2/

Upvotes: 2

Related Questions