css3的动画效果
过渡
变换
动画
transition: width 2s,height 2s,background-color 2s;
transition: all 2s;
变换
translate(200px,0px)
旋转:transform:rotate(360deg);
比例方法
transform:scale(2,2);
动画
@keyframes myframe{
from{
}
to{
}
}
from to 从啥到啥
按百分比写
animat myframe 5s;
infinite 死循环永远的转
<!DOCTYPE html>
<html>
<head>
<title>过渡效果</title>
<meta charset="utf-8">
<link rel="stylesheet" href="./css/过渡.css">
</head>
<body>
<div class="action">
</div>
</body>
</html>
.action{
width: 200px;
height: 200px;
background-color: red;
/*transition: width 2s,height 2s,background-color 2s;*/
/*transition: all 2s;*/
transition: transform 2s;
}
.action:hover{
animation: myf 5s;
/*width: 400px;
height: 400px;
background-color: green;*/
/*transform:translate(200px,0px);*/
/* transform:rotate(360deg);*/
transform:scale(2,2);
}
@keyframes myf{
from{
background: red;
}
to{
background: green;
}
}

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



