<style>
body {
background-color: gray;
}
.loading-box {
margin: 100px auto;
height: 150px;
width: 250px;
}
.loading {
height: 20px;
width: 100%;
border-radius: 10px;
border: 1px solid green;
position: relative;
}
.loading::before {
content: '';
display: block;
position: absolute;
width: 0%;
height: 100%;
background-color: red;
top: 0;
left: 1px;
border-radius: 10px;
animation: load 2s linear infinite;
}
@keyframes load {
from {
width: 0%;
}
to {
width: 100%;
}
}
p {
font-size: 20px;
color: green;
text-align: center;
margin: 0;
}
</style>
</head>
<body>
<div class="loading-box">
<div class="loading">
</div>
<p>Loading...</p>
</div>
</body>
CSS加载条
最新推荐文章于 2024-04-27 17:15:07 发布