html - 仅在 id 内应用 "webkit-keyframes"

标签 html css

我如何只在 id #progress1 中应用“webkit-keyframes”?我想这样做是因为页面中将有另一个进度条 (#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% }
}

最佳答案

不可能在 CSS 中限定动画范围。只是给他们不同的名字。不要将它们都称为 progress

关于html - 仅在 id 内应用 "webkit-keyframes",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29064598/

相关文章:

php - 如何使用ajax传递html代码块并将其保存到mysql

html - Paypal 按钮格式不正确

javascript - 单击链接时显示 jQuery Accordion?

css - CSS 中的换行符和排版

html - 如何在 Bootstrap 中制作全 Angular 大型菜单

php - 如何使用 php 查找并删除字符串中的最后一个链接标签?

html - 当元素为空时如何删除上边距?

javascript - 如何在 css 表中使用 js 文件中的数字?

html - 使用 CSS 定位 Flash 内容

javascript - 如果我点击,我想移动盒子