1. 程式人生 > 實用技巧 >純css讓背景圖片不停圍繞中心旋轉

純css讓背景圖片不停圍繞中心旋轉

效果圖:



<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<title>Title</title>
<style>
.logo{
text-align:center;
margin-top:100px;
}
@keyframesrotation{
from{
transform:rotate(0deg);
}
to{
transform:rotate(360deg);
}
}

.Rotation{ transform:rotate(360deg); animation:rotation8slinearinfinite; }
.img{ border-radius:200px; } </style> </head>
<body> <divclass="logo"> <imgclass="Rotationimg"src="http://cdn.jingqueyun.com/turntable/image/theme/theme2/turntable-outer-bg2.png"width="128"height="128"/> </div> </body> </html>