4

我有这个示例

我想将进度条反转 180 度以从右到左进行。要获得这样的东西:

在此处输入图像描述

我试图改变过渡属性,但没有结果。

代码 :

.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;      
}
4

2 回答 2

6

制作进度条块并将其浮动到右侧:

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

演示

于 2013-04-15T14:22:39.877 回答
2

将 span 设为块元素并使用margin-left. 但是您也需要反转进度。例如 30% 的需求margin-left:70%

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

于 2013-04-15T14:20:37.350 回答