分类分类
更新时间:2026-08-08 18:01:54作者:yezheng
本文将介绍css3实现图形的动画效果的方法,有需要的朋友来看下吧
1. [CSS]代码如下:
css代码:
.image{
width: 100px;
height: 100px;
/* background-color: forestgreen;*/
position: relative;
-webkit-animation: anim 5s;
-moz-animation: anim 5s;
-ms-animation: anim 5s;
-o-animation: anim 5s;
animation: anim 5s infinite alternate;
}
@-webkit-keyframes anim {
0%{
background-color: aliceblue;
left: 0px;
top: 0px;
}
25%{
background-color: aqua;
left: 200px;
top: 0px;
}
50%{
background-color: blue;
left: 200px;
top: 200px;
}
75%{
background-color: blueviolet;
left: 0px;
top: 200px;
}
100%{
background-color: chartreuse;
left: 0px;
top: 0px;
}
}
@-moz-keyframes anim{
0%{
background-color: aliceblue;
left: 0px;
top: 0px;
}
25%{
background-color: aqua;
left: 200px;
top: 0px;
}
50%{
background-color: blue;
left: 200px;
top: 200px;
}
75%{
background-color: blueviolet;
left: 0px;
top: 200px;
}
100%{
background-color: chartreuse;
left: 0px;
top: 0px;
}
}
@-ms-keyframes anim {
0%{
background-color: aliceblue;
left: 0px;
top: 0px;
}
25%{
background-color: aqua;
left: 200px;
top: 0px;
}
50%{
background-color: blue;
left: 200px;
top: 200px;
}
75%{
background-color: blueviolet;
left: 0px;
top: 200px;
}
100%{
background-color: chartreuse;
left: 0px;
top: 0px;
}
}
@-o-keyframes anim {
0%{
background-color: aliceblue;
left: 0px;
top: 0px;
}
25%{
background-color: aqua;
left: 200px;
top: 0px;
}
50%{
background-color: blue;
left: 200px;
top: 200px;
}
75%{
background-color: blueviolet;
left: 0px;
top: 200px;
}
100%{
background-color: chartreuse;
left: 0px;
top: 0px;
}
}
HTML;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>动画</title>
<link rel="stylesheet" type="text/css" href="css/style02.css">
</head>
<body>
<div class="contaner">
<div class="image">
</div>
</div>
</body>
</html>
相关
星球小队策略游戏316.49 MBv1.15.366.638912026-08-08
下载超市大亨3D经营养成253.14 MBv10.252026-08-08
下载绝世武林角色扮演453.09 MBv1.8.14162026-08-08
下载Crush Crush手机版经营养成124.86 Mv0.4482026-08-08
下载消消大亨经营养成13.56 Mv1.0.02026-08-08
下载endacopia手机版冒险游戏1.43Gv1.0.02026-08-08
下载最强帮主角色扮演143.91 Mv9991.12026-08-08
下载战西游手游折扣版策略游戏13.77 Mv1.02026-08-08
下载富豪物语创业时代官方版经营养成215.01 Mv3.0.12026-08-08
下载咒术回战爱憎乱斗手游动作射击291.7 Mv1.0.02026-08-08
下载三国吧兄弟折扣版策略游戏380.04 Mv1.0.02026-08-08
下载代号97动作射击277.47 Mv1.0.72026-08-08
下载










