31、过渡
transition:height 0.3s
transition: property duration timing-function delay;
transition-property:height、width等等属性名
transition-duration:时间间隔0.3s,单位毫秒
transition-timing-function:(贝塞尔曲线)
ease:先加速在减速 (默认值)
ease-in:加速引动
ease-out:减速运动
ease-in-out:先加速在减速,与ease相同,但是速度不同
cubic-bezier(0,0,1,1):贝塞尔曲线匀速,可以去找网址参数
step(2,end):分两步执行与时间搭配使用。第二个值start或end,开始时执行还是结束时执行
transition-delay:延时几秒再开始
transition-delay:2s

简写属性:无次序要求,如要写延时,泽第一个时间为持续时间
transition:height 2s 1s
32、动画
@keyframes关键帧定义
animation-name名称
animation-duration持续时间
animation-delay延时时间
animation-iteration-count重复次数
animation-direction方向
animation-timing-function运动方式
animation-fill-mode模式
animation简写
使用方法
使用
.box{
animation-name:“名称”;名称
animation-duration:4s;持续时间
animation-delay:3s;延迟
animation-iteration-count:2/infinite;无限重复;
animation-direction:normal/(从from到to方向)。reverse相反。alternate/来回执行。
alternate-reverse/同上想反来回执行。;
animation-paly-state:running动画执行。paused暂停;
animation-timing-function:运动方式;
animation-fill-mode:none,执行完后好回到原位。forwards执行 完毕最后to位置。
backwards延迟等待时处于开始位置。both具备forwards和backwards;
}
定义
@keyframes “名称”: {
from {background-color: red;} from=0%
to {background-color: yellow;}to=100%
0%{}
30%{}
100%{}
}
简写方式
animation: 名称5s linear 2s infinite alternate同样持续时间必须在延迟前面
33、变形
div
{
margin:30px;
width:200px;
height:100px;
background-color:yellow;
/* Rotate div */
transform:rotate(9deg);
-ms-transform:rotate(9deg); /* Internet Explorer */
-moz-transform:rotate(9deg); /* Firefox */
-webkit-transform:rotate(9deg); /* Safari 和 Chrome */
-o-transform:rotate(9deg); /* Opera */
}

属性如下,并且变形不会影响页面布局

z轴变化需要设置视距:
perspective:1000px
先转再移和先移再转效果不一样
所有实验结果可在此查看效果
补充:opacity:0-1元素透明状态
3D旋转效果:transform-style:perserve-3d
598




被折叠的 条评论
为什么被折叠?



