admin管理员组文章数量:1616032
效果图:
素材及代码:
https://474b/f/1445568-484420276-75767d
(访问密码:5719)
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.bg1 {
position: absolute;
width: 1920px;
height: 600px;
top: 200px;
background: url(images/bg1.png) no-repeat;
animation: move_bg 50s linear infinite;
}
.bg2 {
top: 600px;
width: 1920px;
height: 600px;
background: url(images/bg2.png) no-repeat;
animation: move_bg 80s linear infinite;
}
.bear {
position: absolute;
top: 400px;
width: 200px;
height: 100px;
background: url(images/bear.png) no-repeat;
animation: bear 1s steps(8) infinite, move 1s forwards;
z-index: 1;
}
@keyframes bear {
0% {
background-position: 0 0;
}
100% {
background-position: -1600px 0;
}
}
@keyframes move {
0% {
left: 0;
}
100% {
left: 50%;
/* margin-left: -100px; */
transform: translateX(-50%);
}
}
@keyframes move_bg {
0% {
background-position: 0 0;
}
100% {
background-position: 100% 0;
}
}
</style>
</head>
<body>
<div class="bear"></div>
<div class="bg1"></div>
<div class="bg2"></div>
</body>
</html>
版权声明:本文标题:利用CSS3动画制作“百度浏览器”官网奔跑的北极熊 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728734438a1170764.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论