コメントはJSと解決策を示しています。だから私は唯一のアニメーションや遅延にCSSでそれを行う方法を追加することで、これを完成させます。ここでは
.item {
height: 50px;
width: 50px;
margin-top: 10px;
background: black;
animation: colorit 0.5s linear;
-webkit-animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
-o-animation-fill-mode: forwards;
-ms-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.item:nth-child(2) {
animation-delay: 0.5s;
}
.item:nth-child(3) {
animation-delay: 1s;
}
.item:nth-child(4) {
animation-delay: 1.5s;
}
@keyframes colorit {
from {
background-color: black;
}
to {
background-color: green;
}
}
@-webkit-keyframes colorit {
from {
background-color: black;
}
to {
background-color: green;
}
}
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
こんにちは。これまでに何を試しましたか? –
確認するには、最初の項目divに緑色の背景色を適用し、それを削除して2番目の項目に適用したいのですか? –
[これは役立つかもしれません](http://stackoverflow.com/questions/25351205/changing-color-of-multiple-divs-one-after-another) –