页面须要一个动画,设计师给了动画的序列帧css
项目由vue构建,使用css3作动画html
<div class="work_two_main"></div>
使用媒体查询兼容PC端vue
// 两人工做 .work_two_main{ width: 375px; height: 367.5px; margin: 0 auto; background: url('./../assets/images/person/work_two.png') 0 0 no-repeat; background-size: 8625px 367.5px; animation: step2 1.5s steps(23) infinite; } @keyframes step2 { 0% { background-position: 0 0; } 100% { background-position: -8625px 0; } } // 兼容pc @media screen and (min-width: 540px) { .work_two_main{ width: 375px; height: 367.5px; margin: 0 auto; background: url('./../assets/images/person/work_two.png') 0 0 no-repeat; background-size: 8625px 367.5px; animation: step2 1.5s steps(23) infinite; transform: scale(1.4); // 兼容pc } }
在网上查询资料后发现抖动有可能由rem引发,将rem修改成px后依然有抖动。css3
请你们指点下,谢谢你们。web
参考资料http://www.yyyweb.com/4993.html后下载此demo,将图片修改成项目图片,发现页面仍然抖动,找设计师修改图片后仍然抖动。动画
参考资料https://blog.csdn.net/u011423258/article/details/82378992使用媒体查询兼容PC端。url
https://aotu.io/notes/2016/05/17/css3-animation-frame/index.htmlspa