在css中,可以使用animation属性和@keyframes规则给img图片元素设置上下浮动动画效果来让图案上下浮动;动画的快慢速度可以通过元素高度与animation中的秒数去调整。

本教程操作环境:Windows7系统、HTML5&&CSS3版本,Dell G3电脑。
推荐:css视频教程
css3实现一个上下浮动的动画效果(animation)
CSS
@keyframes movepoint {
25% {
top: 16px
}
100%,
{
top: 50px
}
}
.shade-button-point {
display: inline-block;
position: absolute;
top: 50px;
left: 30%;
animation: movepoint 2s infinite;
-webkit-animation: movepoint 2s infinite;
}
HTML
<div> <button>点我点我快点我</button> @@##@@ </div>
效果图:
更多编程相关知识,请访问:编程教学!!

前端入门到VUE实战笔记:立即使用
在学习笔记中,你将探索 前端 的入门与实战技巧!











