前言

animation css3属性设置动画,css复合属性,可以追加多个css属性,不可被继承,  
@keyframes定动画,可以定义动画的起始位置,有参考点,定义位置属性等

基本语法

  • animation-name 规定的动画名称 与keyframes 里面的名称对应
  • animation-duration 规定动画完成一个周期所需要的时间,如果为0 表示没有动画
  • animation-direction 定义的方向 ie10以上支持 ,normal 正常播放,alternate 偶数反方向播放
  • animation-timing-function: linear 从头到尾相同的 ease 开始和结束慢 ease-in 开始慢 ease-out 结束慢 ease-in-out 以低俗开始和结束 cubic-bezier(n,n,n,n) 速度曲线 可能是0-1 之间的数值
  • animation-delay 动画延迟时间
  • animation-iteration-count :n infinite 指定次数或者无限次
  • animation-play-state :paused running 规定以暂定或者进行中
  • animation-fill-mode :none,forwards backwards both 动画完成之后的样式状态 无 默认的 ;最后一个状态 ,最开始的状态,兼容状态

    参考文章

  • css3 animation(张鑫旭)