CSS3 animation (动画) 属性

@keyframes规定动画

animation 所有动画属性的简写属性,除了animation-play-state属性。

animation-name 动画的名称 (必须的)

animation-duration 完成一共用的时间,默认是0s (必须的)

animation-timing-function 速度曲线,默认 ease 步长 steps()

linear 匀速

ease 默认, 以低速开始,然后加快,在结束前变慢

ease-in 动画以低速开始 , 加速

ease-out 动画以低速结束,减速

ease-in-out 动画以低速开始和结束 ,先加速后减速

steps() 指定了时间函数中的间隔数量(步长)

animation-delay 何时开始,默认 0s

animation-iteration-count 重复次数,默认 1次, infinite 无限循环

animation-direction 来回播放,默认 normal 不倒回 alternate 逆播放

animation-fill-mode 动画结束状态, 默认 backwards 回到起始 forwards 保持

连写

animation:动画名称 持续时间 运动曲线 何时开始 播放次数 是否反方向 动画起始或者结束的状态;

animation: name duration timing-funcion delay iteration-count direction fill-mode ;

animation: name 1s ease 0s infinite alternate forwards;

animation-play-state 鼠标放上运行或暂停,默认 running不暂停 pause 鼠标放上暂停

暂停动画:animation-play-state:puased;经常和 :hover 经过等其他配合使用

  • 9
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CSS3 animation属性是用来定义一个元素的动画效果。它包括了多个子属性,如animation-name、animation-duration、animation-timing-function、animation-delay、animation-iteration-count、animation-direction、animation-fill-mode和animation-play-state。 其中,animation-name用来定义动画的名称,animation-duration用来定义动画的持续时间,animation-timing-function用来定义动画的时间函数,animation-delay用来定义动画的延迟时间,animation-iteration-count用来定义动画的播放次数,animation-direction用来定义动画的播放方向,animation-fill-mode用来定义动画结束时元素的样式,animation-play-state用来定义动画的播放状态。 更具体地说,animation-name用来绑定动画规则到选择器上,而animation-duration用来定义动画播放一次的时间长度。animation-timing-function则用来定义动画的时间函数,控制动画的速度曲线。animation-delay用来定义动画开始播放的延迟时间,而animation-iteration-count用来定义动画的重复次数。animation-direction则用来定义动画播放的方向,可以是正向、反向或循环播放。animation-fill-mode则用来定义动画在播放前和播放后所应用的样式,可以是保持初始状态或保持最后状态。最后,animation-play-state用来定义动画的播放状态,可以是暂停或播放。 综上所述,CSS3 animation属性是用来定义元素的动画效果的,它包括了多个子属性,每个属性都有自己的作用,用来控制动画的各个方面,如持续时间、播放次数、延迟时间等。通过合理使用这些属性,可以创建出各种丰富多样的动画效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [css3动画属性animation](https://blog.csdn.net/qq_40340943/article/details/100733638)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [css动画-animation各个属性详解](https://blog.csdn.net/weixin_45810135/article/details/108921359)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值