css实现旋转加载动画效果
纯css实现转圈加载动画,直接上代码
Html代码:
<svg class="circular" viewbox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" />
</svg>
Css代码:
.circular {
width: 100px;
height: 100px;
animation: rotate 2s linear infinite;
}
.path {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
stroke: #000;
animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate {
100% {
transform: rotate(360deg);
}
}
@keyframes dash {
0% {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89, 200;
stroke-dashoffset: -35px;
}
100% {
stroke-dasharray: 89, 200;
stroke-dashoffset: -124px;
}
}
效果如下:

相关推荐
-
MySQL进阶垫脚石:线程长时间处于killed状态怎么破?
MySQL进阶垫脚石:线程长时间处于killed状态怎么破?2025-04-30 01:10:02 -
「你真的知道吗?」Mysql中的DDL, DML, DCL, 和TCL介绍
「你真的知道吗?」Mysql中的DDL, DML, DCL, 和TCL介绍2025-04-30 00:52:57 -
PHP页面跳转2025-04-30 00:44:40
-
php调用自己的方法报错5002025-04-30 00:16:34
-
MYSQL常用查询Columns和Views2025-04-30 00:14:51