1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>旋转</title> 6 <style type="text/css"> 7 #div1{ 8 width: 200px; 9 height: 200px; 10 background: green; 11 margin: 100px auto; 12 /*动作是在hover指定,而原点是在div指定*/ 13 transform-origin: right top;/*围绕右上点旋转 origin (原点)*/ 14 } 15 #div1:hover{ 16 transform: rotate(30deg); 17 } 18 </style> 19 </head> 20 <body> 21 <div id="div1"></div> 22 </body> 23 </html>