1. 程式人生 > >滑鼠滑過圖片圖片放大

滑鼠滑過圖片圖片放大

<!doctype html>
<html>
<head>
<style>
  img {
      display:block;
    }
  .imgbox {
      width:160px;
      border:solid 2px gray;
      height:120px;
      overflow:hidden;
    }
  .imgbox img {
      width:160px;
      height:120px;
      position:relative; 
      transition:all 1s;
    }
  .imgbox:hover img{
      -webkit-transform:scale(1.5,1.5);
    }
</style>
<meta charset="utf-8">
<title>css滑鼠經過圖片放大效果</title>
</head>

<body>

<div class="imgbox">
    <img src="https://inews.gtimg.com/newsapp_bt/0/5934412585/1000">
</div>

</body>
</html>