效果:

使用CSS3完成loading的制作

css样式:

 <style type="text/css">
.mask {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.1);
} .mask-loading {
position: absolute;
top: 40%;
left: 50%;
transform: translateX(-50%);
} .mask-loading div {
width: 20px;
height: 20px;
float: left;
margin-right: 5px;
background-color: #0179B5;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
} .mask-loading div:nth-child(1) {
-webkit-animation: loading 0.5s ease 0s infinite alternate;
animation: loading 0.5s ease 0s infinite alternate;
} .mask-loading div:nth-child(2) {
-webkit-animation: loading 0.5s ease 0.1s infinite alternate;
animation: loading 0.5s ease 0.1s infinite alternate;
} .mask-loading div:nth-child(3) {
margin-right: 0;
-webkit-animation: loading 0.5s ease 0.2s infinite alternate;
animation: loading 0.5s ease 0.2s infinite alternate;
} @keyframes loading {
from {
/*缩放*/
transform: scale(1);
background-color: lightcoral;
}
to {
transform: scale(0.5);
background-color: #0179B5;
}
} @-webkit-keyframes loading {
from {
transform: scale(1);
background-color: lightcoral;
}
to {
transform: scale(0.5);
background-color: #0179B5;
}
} @-moz-keyframes loading {
from {
transform: scale(1);
background-color: lightcoral;
}
to {
transform: scale(0.5);
background-color: #0179B5;
}
} @-o-keyframes loading {
from {
transform: scale(1);
background-color: lightcoral;
}
to {
transform: scale(0.5);
background-color: #0179B5;
}
}
</style>

HTML:

<body>
<div class="mask">
<div class="mask-loading">
<div></div>
<div></div>
<div></div>
<p>Loading...</p>
</div>
</div>
</body>

  

最新文章

  1. Hive的三种安装方式(内嵌模式,本地模式远程模式)
  2. Cocopod上更新上传自己的开源框架供别人下载
  3. Metasploit辅助模块
  4. tiled工具使用
  5. 传说中的WCF(5):数据协定(a)
  6. JDK1.8聚合操作
  7. java学习之异常笔记
  8. Flex上传文件
  9. read gc log
  10. VB.NET中的常用方法
  11. web移动端Fixed在Input获取焦点时ios下产生的BUG及处理
  12. [2019BUAA软工助教]第0次个人作业
  13. CF1139E Maximize Mex
  14. Git创建本地仓库、与远程仓库关联
  15. tmux用法【常用】
  16. JS读取.properties文件的方法
  17. ios学习--iphone 实现下拉菜单
  18. Linux中搭建一个ftp服务器详解
  19. vue组件知识点
  20. Alpha答辩总结

热门文章

  1. CentOS虚拟机断电或强制关机,再开机出现问题:Entering emergency mode. Exit the shell to continue.
  2. UVALive - 6436、HYSBZ - 2435 (dfs)
  3. 记.net 遇到的几个bug
  4. jQuery 学习笔记(TryjQuery)
  5. mvc Area(区域)相关技术
  6. 制作web安装程序
  7. 让EntityFramwork自动更新表结构
  8. 消息摘要java.security.MessageDigest
  9. 【ExtJS】FormPanel表单验证
  10. MySql的存储引擎介绍