<style>
body,
html {
width: 100%;
height: 100%;
margin: 0;
}
.loading-box {
position: absolute;
width: 50px;
height: 50px;
border-top: 8px solid rgb(173, 213, 162);
border-right: 8px solid rgb(173, 213, 162);
border-bottom: 8px solid rgb(210, 184, 44);
border-left: 8px solid rgb(210, 184, 44);
border-radius: 50%;
top: 50%;
left: 50%;
margin-top: -25px; /*height的一半*/
margin-left: -25px; /*width的一半*/
animation: loading 1s linear infinite;
}
@keyframes loading {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(90deg);
}
50% {
transform: rotate(180deg);
}
75% {
transform: rotate(270deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="loading-box"></div>
</body>
CSS+HTML实现环形加载动画
最新推荐文章于 2025-03-25 13:51:58 发布