這是我用于影片背景的 css 代碼,但它太快了,一切都發生在一秒鐘之內。請有人幫我解決這個問題的任何想法。我是新來的
.one{
animation: changeBg 1s infinite;
width:100%;
height:450px; }
@keyframes changeBg{
0%,100% {background-image: url("../project1/img/hero1.jpg");
}
25% {
background-image: url("../project1/img/hero2.jpg");
}
50% {
background-image: url("../project1/img/hero3.jpg");
}
75% {
background-image: url("../project1/img/hero4.jpg");
}
uj5u.com熱心網友回復:
.one{
animation: changeBg 3s infinite;
width:100%; /* ^^^^ */
height:450px;
}
將 1s 更改為您想要的任何持續時間
可以以秒 (s) 或毫秒 (ms) 為單位
W3 Schools: animation-duration
uj5u.com熱心網友回復:
在1s中animation: changeBg 1s infinite;是你的時間。您可以增加,另外可以添加影片定時功能一樣ease,linear...等
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/367538.html
