CSS实现静态图片的旋转,当然也包括背景图片:
@-webkit-keyframes rotation{ from {-webkit-transform: rotate(0deg);} to {-webkit-transform: rotate(360deg);} } .an { -webkit-transform: rotate(360deg); animation: rotation 5s linear infinite; -moz-animation: rotation 5s linear infinite; -webkit-animation: rotation 5s linear infinite; -o-animation: rotation 5s linear infinite; }
如果要倾斜着旋转,就改成:
@-webkit-keyframes rotation{ from {-webkit-transform:skew(52deg) rotate(0deg);} to {-webkit-transform:skew(52deg) rotate(360deg);} }