<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>奔跑的熊大</title>
<style>
* {
padding: 0;
margin: 0;
}
body {
position: relative;
}
.mountain {
position: absolute;
top: 380px;
width: 3840px;
height: 336px;
background: url(bg1.png) repeat-x;
animation: mountain 15s linear infinite;
width: 100%;
}
.bear {
position: absolute;
top: 212px;
width: 200px;
height: 100px;
background: url(bear.png) no-repeat;
animation: bear 2s steps(8) infinite, move 3s linear forwards;
}
@keyframes bear {
0% {
background-position: 0 0;
}
100% {
background-position: -1600px 0;
}
}
@keyframes move {
0% {
left: 0;
}
100% {
left: 50%;
transform: translate(-50%, 0);
}
}
@keyframes mountain {
0% {
background-position: 0 0;
}
100% {
background-position: -3840px 0;
}
}
</style>
</head>
<body>
<div class="mountain">
<div class="bear">
</div>
</div>
</body>
</html>
奔跑的熊大
最新推荐文章于 2024-10-31 14:03:24 发布