前端 CSS 经典:水波进度样式

前言:简单实现水波进度样式,简单好看。

效果图:

代码实现:

html 复制代码
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
      name="viewport"
      content="initial-scale=1.0, user-scalable=no, width=device-width"
    />
    <title>document</title>
    <style>
      body {
        background: #000;
      }
      .indicator {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3em;
        margin: 200px auto;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        border: 2px solid #fff;
        position: relative;
        overflow: hidden;
        color: #fff;
      }
      .indicator span {
        position: absolute;
        z-index: 999;
      }
      .indicator::after {
        content: "";
        width: 200px;
        height: 200px;
        border-radius: 60px;
        position: absolute;
        left: -50%;
        top: 50px;
        background: blue;
        animation: rotate 5s linear 0s infinite;
      }
      @keyframes rotate {
        from {
          transform: rotateZ(0deg);
        }
        to {
          transform: rotateZ(359deg);
        }
      }
    </style>
  </head>
  <body>
    <div>
      <div class="indicator">
        <span>50</span>
      </div>
    </div>
    <script></script>
  </body>
</html>
相关推荐
a11177617 分钟前
莱茵生命终端 网页 html
前端·开源
水月清辉38 分钟前
CSS 常用语法详解
前端·css
Eric_见嘉1 小时前
打开这个 VSC 设置「组件引用位置」和数量就都清楚了
前端·typescript·visual studio code
李高钢1 小时前
Python Tornado 框架入门:从零搭建你的第一个异步 Web 应用
前端·python·tornado
宁风2 小时前
JavaScript:函数体系-1
前端·javascript
mmsx2 小时前
Android 手簿 ADB 无线调试全攻略:USB 转 WiFi 一键连接
android·前端
guwentian2 小时前
Rolldown vs esbuild vs Webpack:Rust 打包器大战我们该怎么选
前端·webpack·rust·esbuild
特立独行的猫A2 小时前
用纯 Rust 重写 Podcastfy:把网页、PDF 和一段文字,变成一档双人对话播客
前端
oooo_z2 小时前
美股历史K线数据API接口选型指南:iTick覆盖1分钟到月线全周期
服务器·前端·javascript
今日无bug2 小时前
从 0 到 1 搭建端侧 AI 项目:DeepSeek-R1 + WebGPU + React + TS + Tailwind 全栈笔记
前端·react.js·typescript