第八节 css3动画之transform缩放

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6     <style type="text/css">
 7         .box{
 8             width: 100px;
 9             height: 100px;
10             background-color: gold;
11             margin: 50px auto 0;
12             transition: all 0.5s ease 0s;  /* 同时加入动画效果 */
13         }
14 
15         .box:hover{
16             /* transform位移比定位位移的性能更高,因为其不影响整体布局,建议使用transform位移 */
17             transform: scale(2,2);  /* 放大一倍 */
18         }
19     </style>
20 </head>
21 <body>
22     <div class="box"></div>
23 </body>
24 </html>
原文地址:https://www.cnblogs.com/kogmaw/p/12492471.html