HTML5+CSS3 网页设计制作首页按钮问题

在网页中添加动态图片,使鼠标在按钮上方时有动态效果

你说的是sprite animation图片,监听到鼠标移动上图片,然后不断重复规律移动图片的一定像素达到循环播放的效果

 <style>
        .box1{height: 256px;width: 256px;margin: 0px auto;background-image: url(./img/bg2.png);
       animation:run 1s steps(6) infinite;
        }
        @keyframes run{from{background-position: 0 0;} to{background-position: -1536px 0;}}
    </style>

插入一张雪碧图然后循环动画即可

:hover