CSS3-旋转齿轮

查看DEMO

通过 CSS3,我们能够创建动画,这可以在许多网页中取代动画图片、Flash 动画以及 JavaScript。

先来认识一下css3的animation

animation的简写animation: name duration timing-function delay iteration-count direction;

其次就是@keyframes

好了,接下来运用上述两个属性做一个可以旋转的齿轮

<style>
.img {
margin: 0 auto;
text-align: center;
width: 400px;
height: 400px;
padding: 0; animation-name:myrotate;
animation-duration:3s;
animation-timing-function:linear;
animation-delay:0s;
animation-iteration-count:infinite;
animation-direction:normal;
animation-play-state:running; -moz-animation-name:myrotate;
-moz-animation-duration:3s;
-moz-animation-timing-function:linear;
-moz-animation-delay:0s;
-moz-animation-iteration-count:infinite;
-moz-animation-direction:normal;
-moz-animation-play-state:running; -webkit-animation-name:myrotate;
-webkit-animation-duration:3s;
-webkit-animation-timing-function:linear;
-webkit-animation-delay:0s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:normal;
-webkit-animation-play-state:running; -o-animation-name:myrotate;
-o-animation-duration:3s;
-o-animation-timing-function:linear;
-o-animation-delay:0s;
-o-animation-iteration-count:infinite;
-o-animation-direction:normal;
-o-animation-play-state:running;
} @keyframes myrotate {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
@-moz-keyframes myrotate {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(360deg);}
}
@-webkit-keyframes myrotate {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}
@-o-keyframes myrotate {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(360deg);}
}
</style> <div class="img">
<img src="chilun.png" alt="">
</div>

CSS3-旋转齿轮的更多相关文章

  1. css3旋转倾斜3d小动画

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  2. css3旋转小三角

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. 可控制转速CSS3旋转风车特效

    以前制作网页动画一般使用javascript,现在已经有越来越多动动画使用纯CSS实现,并且动画的控制也可以使用CSS3实现,因为CSS 3来了,CSS 3的动画功能确实强大.以下是一个纯CSS3制作 ...

  4. 源码分享-纯CSS3实现齿轮加载动画

    纯CSS3实现齿轮加载动画是一款可以用来做Loading动画的CSS3特效代码. 有兴趣的朋友可以下载下来试试:http://www.huiyi8.com/sc/8398.html

  5. 诺基亚 920T - 我的非凡系列手机始终显示旋转齿轮而无响应,我该如何让手机停止显示旋转齿轮?

    有时,在 OTA 更新 (或重置手机) 后,设备可能始终显示“旋转齿轮”而无响应. 如果“旋转齿轮”在屏幕上显示的时间超过 60 分钟,则需要执行恢复操作. 您可以尝试下面这些简单的解决方法: 按住电 ...

  6. CSS3 旋转 太阳系

    参考https://www.tadywalsh.com/web/cascading-solar-system/ 首先 旋转有两种方式  一种是使用 transform-origin  另一种是tran ...

  7. css3旋转

    首先创建一个容器如div,然后设置其相关的3d属性,主要是三个1.perspective 透视,值越小3D感越强,值越大视觉正常.2.perspective-origin,透视点一般居于容器的中心.3 ...

  8. CSS3 旋转代码备忘

    .Aclose { -webkit-transition-property: all; -webkit-transition-duration: .3s; -moz-transition-proper ...

  9. CSS3旋转缩放移动倾斜等效果——transform

    1.transform浏览器支持情况 也就是说目前不考虑老浏览器的话是不用加前缀的,感谢菜鸟教程:https://www.runoob.com/cssref/css3-pr-transform.htm ...

  10. css3旋转、过渡、动画属性

    1.transform 该属性对元素进行旋转.缩放.移动和倾斜 translate元素从当前位置移动 rotate元素顺时针旋转 scale元素的尺寸增大或减小 skew元素翻转 2.transiti ...

随机推荐

  1. php mvc 框架演示

    <pre name="code" class="cpp"><pre name="code" class="pyt ...

  2. 解决libc.so.6: version `GLIBC_2.14' not found问题, 升级glibc,glibc-2.15

    0.以下在系统CentOS 6.3 x86_64上操作 1.试图运行程序,提示"libc.so.6: version `GLIBC_2.14' not found",原因是系统的g ...

  3. HDU 5763 Another Meaning(FFT)

    [题目链接] http://acm.hdu.edu.cn/showproblem.php?pid=5763 [题目大意] 给出两个串S和T,可以将S串中出现的T替换为*,问S串有几种表达方式. [题解 ...

  4. mysql 的卸载、再安装与常用命令

    1.卸载mysql.完全删除: 删除 mysqlsudo apt-get autoremove --purge mysql-server-5.0sudo apt-get remove mysql-se ...

  5. DICOM医学图像处理:DCMTK在VS2012中的配置

    背景: 近期因为项目须要,将原本的开发IDE环境由VS2008升级到了VS2012.本以为编译完毕后的DCMTK开源库能够直接从VS2008移植到VS2012.可是通过项目属性加入完包括文件夹和依赖库 ...

  6. VS2015操作Oracle数据需要做那些设置?

    1>在oracle网上下载:ODP.NET 2> 要根据自己的oracle 数据32bit/64bit,选择下载. 3> 根据提示配置tnsnames.ora文件. # alias ...

  7. 关于对象和this、new

    //创建一个猫类 function Cat(name,color,eyeColor){ //上面处Cat首字母大写表示创建一个‘类别’叫Cat类.假如首字母小写cat则是创建一个cat的函数: thi ...

  8. zoj 3197 Google Book

    这道题告诉我想法正确是多么重要,先是我自己想的时候没考虑到最后的页码作为循环的终止,我一直以区间个数来终止循环,这是多么愚蠢啊!然后,我看了别人的代码,但是很不幸超时了! 我自己wa的代码,我感觉很正 ...

  9. UIGI 一级二级三级四级啦啦啦等列表层式排列效果

    在每个需要排序的物体上放入GridTag 脚本 其中GridTag脚本用于提供此物体的深度 using UnityEngine; using System.Collections; using Uni ...

  10. TreeSet两种比较

    TreeSet底层数据结构是二叉树 判断对象是否一致是通过是对象自身有比较的方法,即使类实现Comparable接口,重写compareTo方法,自己定义比较规则, 若是不想用元素本身的比较方法,又不 ...