点击查看html编辑器说明文档

简单的加载中(loading...)效果edit icon

|
|
Fork(复制)
|
|
作者:
lynn-ssk
提交反馈
嵌入
设置
下载
HTML
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ...
展开
</head>
<body>
            
            <section>
  <div class="container">
    <h1>Loading...</h1>
  </div>
</section>
        
</body>
CSS
格式化
            
            * {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
body {
  font-family: "Montserrat";
}
section {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: aliceblue;
}
.container {
  padding: 20px 40px;
  border: 2px solid black;
  letter-spacing: 10px;
  position: relative;
  text-transform: uppercase;
  font-size: 24px;
}
.container::after {
  content: "";
  position: absolute;
  height: 100%;
  width: 0%;
  left: 0;
  top: 0;
  background-color: rgb(255, 255, 255);
  mix-blend-mode: difference;
  animation: loader_bg 3s linear infinite alternate;
}
@keyframes loader_bg {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

        
JS
格式化
            
            
        
预览
控制台