web前端CSS可靠的投注网站推荐开元体育app官方版最新下载网站3动画效果animation属性
时间:2025-06-24 00:37:12 阅读(143)
3、
//从什么状态过渡到什么状态
@keyframes myani {
from {
background-color: white;
margin-left:0px;}
to {
background-color: black;
margin-left:100px;}
}
4、需要加上相应的浏览器前缀。有一定的局限性。
除了这9个属性之外,animation-timing-function
//设置缓动
animation-timing-function: ease-in;
属性值 | 说明 |
ease | 默认值,等同于贝塞尔曲线(0.42, 0, 0.58, 1.0) |
cubic-bezier | 自定义三次贝塞尔曲线 |
5、
@keyframes myani {
0% {
background-color: white;
margin-left:0px;}
50% {
background-color: black;
margin-left:100px;}
100% {
background-color: white;
margin-left:0px;}
}
//或者重复的,等同于贝塞尔曲线(0.42, 0,1.0, 1.0)
//一个 div 元素
<div>WEB前端设计</div>
//设置 CSS
div {
width: 200px;
height: 200px;
background-color: white;
border: 1px solid green;}
1.@keyframes
//创建动画的第一步,然后在 animation 调用关键帧声明的动画。animation-name
//调用@keyframes 动画
animation-name: myani;
属性值 | 说明 | ||||||||||||||||||||||||||||||||
none | 默认值,整个动画就一目了然了。次数和播放方向 animation-iteration-count: 4; animation-direction: alternate; 三、和初始状态一致,animation-fill-mode //设置结束后不在返回 animation-fill-mode: forwards;
|