网页效果
代码段(少量注释)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
/* 100窗口高度 */
height: 100vh;
background: linear-gradient(to bottom, #2b6876, #09203f);
/* 弹性盒子 水平 居中 */
display: flex;
justify-content: center;
align-items: center;
}
.loading {
position: relative;
width: 200px;
height: 200px;
/* background-color: pink; */
/* background-color: pink; */
border-top: 10px solid #63a69f;
border-radius: 50%;
/* text-align: center;
line-height: 200px; */
/* 动画1 */
animation: move1 2s linear infinite;
}
.loading::before,
.loading::after {
content: "";
position: absolute;
/* 向上-10px */
top: -10px;
left: 0;
width: 200px;
height: 200px;
/* background-color: #fff; */
border-radius: 50%;
}
.loading::before {
border-top: 10px solid #dfdf0e;
transform: rotate(120deg);
}
.loading::after {
border-top: 10px solid #eaa613;
transform: rotate(240deg);
}
.loading span {
position: absolute;
width: 200px;
height: 200px;
/* background-color: pink; */
color: #fff;
text-align: center;
line-height: 200px;
/* 动画2 */
animation: move2 2s linear infinite;
}
/* 关键帧 */
@keyframes move1 {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
@keyframes move2 {
from {
transform: rotate(0);
}
to {
transform: rotate(-360deg);
}
}
</style>
</head>
<body>
<div class="loading">
<span>拼命加载中</span>
</div>
</body>
</html>