1.以下为代码详情,直接复制即可。
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>图片上下浮动</title>
<style>
*{padding:0;margin:0;}
body{
position:relative;
background:#90C0F1;
overflow:hidden;
}
.ghost{
width:160px;
margin:100px auto;
position:relative;
animation:ghostUpdown 1s infinite alternate;
-webkit-animation:ghostUpdown 1s infinite alternate;
}
@keyframes ghostUpdown{
from{margin-top:100px;}
to{margin-top:70px;}
}
@-webkit-keyframes ghostUpdown{
from{margin-top:100px;}
to{margin-top:70px;}
}
</style>
</head>
<body>
<div class="ghost">
<img src="0.jpg">
</div>
</body>
</html>
2.更多资源加群 372319250,或者 https://one.betters.xin访问更多。
3.源码下载地址:https://one.betters.xin/index/down/details/id/4.html