首页 前端知识 [Html5基础训练]animation的step使用方法

[Html5基础训练]animation的step使用方法

2024-02-11 10:02:43 前端知识 前端哥 498 937 我要收藏
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sprite Demo</title>
<style>
#an {
width: 128px;
height: 128px;
background: url(img/spriteB.png);
animation: move infinite 4s steps(8,end);
}
/* -254,-384 x-1152 1024-128= 896 */
@keyframes move {
0% {
background-position:0 -256px;
}
50% {
background-position:-1024px -256px;
}
50.001% {
background-position:0 -384px;
}
100% {
background-position:-1024px -384px;
}
}
</style>
</head>
<body>
<div id="an"></div>
</body>
</html>
复制

SpriteB图片下载:

转载请注明出处或者链接地址:https://www.qianduange.cn//article/1773.html
标签
评论
还可以输入200
共0条数据,当前/页
发布的文章

Jquery-day01

2024-02-25 11:02:14

Jquery的基本认识

2024-02-25 11:02:11

浏览器调用摄像头

2024-02-25 11:02:09

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!