css设置盒子动画,CSS3 transition动画 animation动画

CSS3 transition动画

transition-property 设置过渡的属性,比如:width height background-color

transition-duration 设置过渡的时间,比如:1s 500ms

transition-timing-function 设置过渡的运动方式

linear 匀速

ease 开始和结束慢速

ease-in 开始是慢速

ease-out 结束时慢速

ease-in-out 开始和结束时慢速

cubic-bezier(n,n,n,n)

比如:cubic-bezier(0.845, -0.375, 0.215, 1.335)

曲线设置网站:https://matthewlein.com/ceaser/

transition-delay 设置动画的延迟

transition: property duration timing-function delay 同时设置四个属性

CSS3 transform变换

translate(x,y) 设置盒子位移

scale(x,y) 设置盒子缩放

rotate(deg) 设置盒子旋转

skew(x-angle,y-angle) 设置盒子斜切

transform-style flat | preserve-3d 设置盒子是否按3d空间显示

perspective 设置透视距离

translateX、translateY、translateZ 设置三维移动

rotateX、rotateY、rotateZ 设置三维旋转

scaleX、scaleY、scaleZ 设置三维缩放

tranform-origin 设置变形的中心点

backface-visibility 设置盒子背面是否可见

CSS3 animation动画

@keyframes 定义关键帧动画

animation-name 动画名称

animation-duration 动画时间

animation-timing-function 动画曲线

linear 匀速

ease 开始和结束慢速

ease-in 开始是慢速

ease-out 结束时慢速

ease-in-out 开始和结束时慢速

steps 动画步数

animation-delay 动画延迟

animation-iteration-count 动画播放次数 n|infinite

animation-direction

normal 默认动画结束不返回

Alternate 动画结束后返回

animation-play-state 动画状态

paused 停止

running 运动

animation-fill-mode 动画前后的状态

WeChat: oneboundbill

相关推荐
雾岛听风6914 小时前
JavaScript基础语法速查手册
开发语言·前端·javascript
遇见~未来4 小时前
第三篇_现代布局_从弹性到网格
前端·css3
前端那点事4 小时前
Vue前端SEO优化全攻略(实操落地版,新手也能上手)
前端·vue.js
Dxy12393102164 小时前
HTML 如何使用 SVG 画曲线
前端·算法·html
用户2367829801684 小时前
从零实现 GIF 制作工具:LZW 压缩与 Median Cut 色彩量化
前端·javascript
hahaha 1hhh4 小时前
中文乱码 ubuntu autodl
linux·运维·前端
Codebee5 小时前
Harness Engineering:AICode 的灵魂
前端·人工智能·前端框架
Highcharts.js5 小时前
线形比赛积分增长或竞赛图|Highcharts企业图表代码示列
开发语言·前端·javascript·折线图·highcharts·竞赛图
hpysirius5 小时前
在企业搭建一套完整的AI Agent系统
前端
追逐梦想永不停5 小时前
记录一个好用的excel判断数字格式的公式
前端·chrome·excel