代码如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>圆边</title>
<style type="text/css">
* {
margin: 0;
padding: 0
}
body {
margin: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.box {
width: 200px;
height: 200px;
font-size: 10px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.box .line {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border-style: solid;
border-color: #00BFFF transparent transparent #00BFFF;
border-width: 2px 2px 0 0;
animation: animate 3s linear infinite normal;
}
@keyframes animate {
to {
transform: rotate(1turn);
}
}
</style>
</head>
<body>
<div class="box">
<div class="line">
</div>
</div>
</body>
</body>
</html>
效果
其他
可以在box 内添加多个line 。给不同的 line 添加不同的 宽高达到,多个圆环绕的效果。再给与不同的 角度和方向,让渐变线达到顺时针和逆时针旋转的效果。