gtxyzz

CSS animation 属性

gtxyzz web技术 2022-07-07 558浏览 0

CSS animation 属性

实例

使用简写属性,将动画与 div 元素绑定:

div
{
animation:mymove 5s infinite;
-webkit-animation:mymove 5s infinite; /* Safari 和 Chrome */
}

定义和用法

animation 属性是一个简写属性,用于设置六个动画属性:

  • animation-name

  • animation-duration

  • animation-timing-function

  • animation-delay

  • animation-iteration-count

  • animation-direction

注释:请始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。


语法

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


继续浏览有关 css 的文章
发表评论