gpt4 book ai didi

css - 动画边框不必要的延迟

转载 作者:技术小花猫 更新时间:2023-10-29 11:32:21 24 4
gpt4 key购买 nike

我正在尝试创建一个无限动画,它按顺序改变边框的颜色(四处移动)。我无法弄清楚每次重复开始时不需要的延迟/跳跃。

#neki {

padding:10px;
border: 6px solid #dcdcdc;
animation: example 1s infinite;

}

@keyframes example {

0% {
border-color: #dcdcdc;
}
25% {
border-left-color: red;
}
50% {
border-top-color: red;
}
75% {
border-right-color: red;
}
100% {
border-bottom-color: red;
}

}
<br>
<span id="neki">awdawdawdwdawda</span>

最佳答案

#neki {
padding: 10px;
border: 6px solid #dcdcdc;
animation: example 1s infinite;
}

@keyframes example {
0%,
100% {
border-top-color: red;
border-right-color: #dcdcdc;
}
25% {
border-right-color: red;
border-bottom-color: #dcdcdc;
}
50% {
border-bottom-color: red;
border-left-color: #dcdcdc;
}
75% {
border-left-color: red;
border-top-color: #dcdcdc;
}
}
<br />
<span id="neki">awdawdawdwdawda</span>

关于css - 动画边框不必要的延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58027169/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com