效果截图:

HTML代码:

<div class="divBox">
<div class="loader">
<div class="loading-1">
<i></i>
<i></i>
<i></i>
</div>
</div>
<div class="loader">
<div class="loading-2">
<i></i>
<i></i>
</div>
</div>
<div class="loader">
<div class="loading-3">
<i></i>
<i></i>
<i></i>
<i></i>
<i></i>
</div>
</div>
</div>

CSS代码:

.divBox{
width: 100%; padding: 3%; box-sizing:border-box;
}
.loader{
width: 30%; height: 260px; float: left; border:1px solid #ccc; margin-right: 3%;
} /*第一个loading动画*/
.loading-1{
position: relative; width: 60px; height: 60px; margin: 100px auto;
}
.loading-1 i{
background-color: #333; width: 60px; height: 60px; border-radius: 50%; position: absolute; left:; top:; opacity:;
}
/*为第一个loading动画定义关键帧*/
@keyframes loading01{
0%{ transform: scale(0); opacity:; }
5%{ opacity:; }
100%{ transform: scale(1); opacity:; }
}
.loading-1 i:nth-child(1){
animation: loading01 1s linear 0s infinite;
}
.loading-1 i:nth-child(2){
animation: loading01 1s linear 0.2s infinite;
}
.loading-1 i:nth-child(3){
animation: loading01 1s linear 0.4s infinite;
}
/*第二个loading动画*/
.loading-2{
width: 40px; height: 40px; margin: 110px auto; position: relative;
}
/*为第二个loading动画定义关键帧*/
@keyframes loading-2{
0%{ transform: rotate(0deg) scale(1); }
50%{ transform: rotate(180deg) scale(0.6); }
100%{ transform: rotate(360deg) scale(1); }
}
.loading-2 i{
position: absolute; border:2px solid #333; border-color: transparent #333; border-radius: 50%;
}
.loading-2 i:first-child{
width: 40px; height: 40px; left:; top:; animation: loading-2 1s ease-in-out 0s infinite;
}
.loading-2 i:last-child{
width: 20px; height: 20px; left: 10px; top: 10px; animation: loading-2 1s ease-in-out 0.4s infinite reverse
}
/*第三个loaing动画*/
.loading-3{
width: 80px; height: 20px; position: relative; margin: 120px auto;
}
/*为第三个loading动画定义关键帧*/
@keyframes loading03{
0%{ left:100px; top:; }
80%{ left:; top:; }
85%{ left:; top: -20px; width: 20px; height: 20px; }
90%{ width: 80px; height: 10px; }
95%{ left:100px; top: -20px; width: 20px; height: 20px; }
100%{ left:100px; top:; }
}
.loading-3 i{
width: 20px; height: 20px; position: absolute; border-radius: 50%; background-color: #333;
}
.loading-3 i:nth-child(1){
animation: loading03 2s linear 0s infinite;
}
.loading-3 i:nth-child(2){
animation: loading03 2s linear -0.4s infinite;
}
.loading-3 i:nth-child(3){
animation: loading03 2s linear -0.8s infinite;
}
.loading-3 i:nth-child(4){
animation: loading03 2s linear -1.2s infinite;
}
.loading-3 i:nth-child(5){
animation: loading03 2s linear -1.6s infinite;
}

CSS3学习笔记之loading动画的更多相关文章

  1. CSS3学习笔记(3)-CSS3边框

    p{ font-size: 15px; } .alexrootdiv>div{ background: #eeeeee; border: 1px solid #aaa; width: 99%; ...

  2. iOS学习笔记-自定义过渡动画

    代码地址如下:http://www.demodashi.com/demo/11678.html 这篇笔记翻译自raywenderlick网站的过渡动画的一篇文章,原文用的swift,由于考虑到swif ...

  3. 十天精通CSS3学习笔记 part4

    CSS3中的变形与动画(下) CSS3 Keyframes介绍 Keyframes 被称为关键帧,其类似于Flash中的关键帧.在CSS3中其主要以"@keyframes"开头,后 ...

  4. CSS3学习笔记之linear-gradient

    我觉得CSS3很不错,自己也稍微看过,并且尝试过一些属性.对我自己而言,我没有勇气说我学过CSS3,我觉得任何自己看来很小的事情,也只是站在自己的角度来评判.就算的是"简单的"HT ...

  5. 十天精通CSS3学习笔记 part3

    第8章 CSS3中的变形与动画(上) 变形--旋转 rotate() 旋转rotate()函数通过指定的角度参数使元素相对原点进行旋转.它主要在二维空间内进行操作,设置一个角度值,用来指定旋转的幅度. ...

  6. CSS3学习笔记(4)—上下滑动展开的按钮

    最近写了一个动画,下面来看看我以前写的一个上下滑动展开的按钮效果: 这类的效果经常会在一些网站页面下载按钮处看到,当你鼠标悬浮在下载按钮时,会提醒你是否已注册,或者点击登录什么的小提示~~~~~ 一. ...

  7. [CSS3] 学习笔记-CSS动画特效

    在CSS3中,出现了很多出彩的效果,例如2D.3D以及过度.动画和多列等.这些效果为页面设计添加了很多的可选设计. 1.2D.3D转换 转换,是使元素改变尺寸.形状.位置的一种效果:通过CSS3转换, ...

  8. CSS3 学习笔记(动画 多媒体查询)

    动画 1.@keyframes规则用于创建动画.在@keyframes中规定某项CSS样式,就能创建由当前样式逐渐改为新样式的动画效果 2.使用animation进行动画捆绑.两个值:动画名称.时长 ...

  9. CSS3学习笔记之立体线框球形动画

    效果截图: HTML代码: <div class="ball-box"> <div class="ball"> <div clas ...

随机推荐

  1. Myeclipse报错-Java compiler level does not match 完美解决方法

    从别的地方导入一个项目的时候,经常会遇到eclipse/Myeclipse报Description  Resource Path Location Type Java compiler level d ...

  2. ActiveMQ测试实例

    ActiveMQ的安装与启动 1 下载ActiveMQ:http://activemq.apache.org/download.html 2 下载后解压到任意文件夹,解压后文件夹内的目录为: 3 进入 ...

  3. EF报错“EntityValidationErrors”

          在使用EF更新实体的时候报错,显示界面如下:       点击查看详情:        在查看详细的窗体中,EntityValidationErrors里面的也看不到具体的错误原因.在网上 ...

  4. Qt BarChart实践

    按照帮助文档编写 运行截图 上代码 #include "widget.h" #include "ui_widget.h" Widget::Widget(QWid ...

  5. Leetcode. 回文字符串的分割和最少分割数

    Q1: 回文字符串的分割 Given a string s, partition s such that every substring of the partition is a palindrom ...

  6. zabbix 语音告警

    之前的文章中已经实现了zabbix 邮件告警和微信告警,生产环境上测试出消息抵达很及时,但是!万一服务器在大半夜突发故障微信.邮件这些通知都是废物了,大晚上还能听到微信通知吗?显然不可能(我的某朋友就 ...

  7. React远程服务

    http://web1.dev5.net:3002/cloud/start?server=exf2&name=zhangxiaocong http://web1.dev5.net:3002/c ...

  8. HDU 4467 Graph(图论+暴力)(2012 Asia Chengdu Regional Contest)

    Description P. T. Tigris is a student currently studying graph theory. One day, when he was studying ...

  9. linux学习(二)——汤哥的推荐书籍

    成为一名精通 Linux程序设计的高级程序员一直是不少朋友孜孜以求的目标. 根据中华英才网统计数据,北京地区 Linux 程序员月薪平均为 Windows程序员的 1.8 倍.Java 程序员的 2. ...

  10. C#中System.DBNull的问题

    今天写一个C#的数据库Demo,第一个功能,用户登录,数据库中用户表(Staff)最后一个字段ZP(呵呵,PowerDesigner中文直接翻译的)照片字段为空, 我的登录逻辑是通过用户名以及密码查询 ...