关于css3:css3逐帧动画

6次阅读

共计 515 个字符,预计需要花费 2 分钟才能阅读完成。

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>png 动画 </title>
<style>
div {
/steps: 为图片的总帧数,也就是说背景图外面有多少个多里的图片 /
animation: 5s steps(23) 0s normal none infinite running ape_amb;
background-image: url("http://www.animalmade.com/files/css/../images/sprite/sprite-animal-ape.png");
background-position:-1821px center;
height: 217px;
margin-left: 210px;
width: 169px;
overflow:hidden;
}
@keyframes ape_amb {
0% {background-position:0px center;}
100% {
background-position: -5113px center;/** 最初一张图片的地位
**/
}
}
</style>
</head>

<body>

</body>

<div>
</div>
</html>
正文完
 0