仅在id中应用“webkit-keyframes”

时间:2015-03-15 18:35:01

标签: html css

我如何应用" webkit-keyframes"只在id#progress1里面?我想这样做是因为页面中会有另一个进度条(#progress2),其中包含不同的webkit关键帧。

#progress1 {
    background: white; /*-- Color of the bar --*/
    height: 30px;
    width: 0%;
    max-width: 100%;
    float: left;
    -webkit-animation: progress 2s 1 forwards;
    -moz-animation: progress 2s 1 forwards;
    -ms-animation: progress 2s 1 forwards;
    animation: progress 2s 1 forwards;
}



@-webkit-keyframes progress { 
    from { }

    to { width: 36% }
}

1 个答案:

答案 0 :(得分:1)

无法在CSS中设置动画范围。给他们不同的名字。不要将它们称为progress