<style> .box { width: 183px; height: 130px; overflow: hidden; border: 1px solid pink; } div img { width: 193px; height: 130px; transition: all 0.4s; } div:hover img { /* margin-left: -10px; */ /* 还可以其他的放式*/ /*transform: translateX(-10px);*/ transform: scale(1.1); } </style> </head> <body> <div class="box"> <!--386*260--> <img src="img/xiaobu.jpg"> </div> </body>
谁做动画,动画效果状态写谁身上,
动画过程写hover中