html炫酷loading
时间: 2023-10-24 20:09:36 浏览: 178
以下是一个使用纯 HTML 和 CSS 实现的简单 loading 效果示例:
```html
<div class="loading">
<div class="loading-bar"></div>
<div class="loading-bar"></div>
<div class="loading-bar"></div>
<div class="loading-bar"></div>
<div class="loading-bar"></div>
</div>
```
```css
.loading {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.loading-bar {
width: 10px;
height: 25px;
margin-right: 5px;
background-color: #fff;
animation: loading 1s ease-in-out infinite;
}
.loading-bar:nth-child(1) {
animation-delay: 0s;
}
.loading-bar:nth-child(2) {
animation-delay: 0.1s;
}
.loading-bar:nth-child(3) {
animation-delay: 0.2s;
}
.loading-bar:nth-child(4) {
animation-delay: 0.3s;
}
.loading-bar:nth-child(5) {
animation-delay: 0.4s;
}
@keyframes loading {
0% {
transform: scale(1);
}
20% {
transform: scale(1, 2.5);
}
40% {
transform: scale(1);
}
}
```
效果如下:
![loading](https://user-images.githubusercontent.com/55872249/126031135-b53f1e8e-3a15-4b04-9aee-2c3e4c5f0eb7.gif)
你可以根据需要调整各个元素的样式和动画效果,实现更加炫酷的 loading 效果。
阅读全文