[英]Problem understanding the keyframes in css
我有以下關鍵幀,我想通過這些關鍵幀來制作Windows徽標的動畫:
.box {
height: 40px;
width: 40px;
float: left;
}
#box1 {
#background-color: red;
animation: box1 4s 1s infinite;
}
#box2 {
#background-color: lightgreen;
animation: box2 4s 1s infinite;
}
@keyframes box2 {
0% {
background-color: #1b2028;
}
25% {
background-color: #1b2028;
}
50% {
background-color: #1b2028;
}
75% {
background-color: lightgreen;
100% {
background-color: #1b2028;
}
}
@keyframes box1 {
0% {
background-color: red;
}
25% {
background-color: red;
}
50% {
background-color: red;
}
75% {
background-color: red;
100% {
background-color: #1b2028;
}
}
但是,問題僅在於關鍵幀之一正在工作。 即只有名稱為box2的關鍵幀有效,而當我將box1的關鍵幀放在頂部時有效,為什么會這樣。 有人可以為我提供關鍵幀的很好的理解嗎? 指向codepen的鏈接是: https ://codepen.io/theredcap/pen/qvJdJa ? editors = 1100
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.