<head lang="en">
<meta charset="UTF-8">
<title>css3 animation transform鱼游动特效</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<style>
body{
background-color: lightblue;
overflow:hidden;
}
.fishbox{
width: 200px;
height: 200px;
/*background-color: rgba(0,0,0,0.4);*/
position: absolute;
left:0;
top:0;
animation: run 20s linear infinite;
animation-direction: normal;
}
.fish{
width: 174px;
height: 126px;
position: absolute;
left:35%;
top:0;
background:url(image/fish8.png) no-repeat left top;
/*transition:all 0.8s steps(8) ;*/
animation:active1 0.8s steps(8) infinite;
这是一款基于css3 animation transform属性制作的鱼游动动画特效,用background-position属性实现两条游动追逐的鱼。
1