鼠标划过图片等比例缩放

65 阅读1分钟

效果

201910231571830463991040.gif

源码

<head>
  <meta charset="UTF-8">
  <title>鼠标划过图片等比例缩放</title>
</head>
<style>
  .divimg {
    width: 270px;
    height: 180px;
    overflow: hidden;
  }

  .divimg:hover img {
    -moz-transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
  }
</style>

<body>
  <div class="divimg">
    <img src="https://wenmayi.com/zb_users/upload/2019/08/201908301567161510836571.jpg">
  </div>
</body>

</html>