版权声明:学习交流。。 https://blog.csdn.net/qq_38881495/article/details/83896991
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>图片在区域里缩放</title>
<style>
.div{
width: 120px;
height: 120px;
overflow: hidden;
background: red;
}
.img{
max-width: 120px;
max-height: 120px;
-moz-transform: scale(2.8,2.8);
-webkit-transform: scale(2.8,2.8);
-o-transform: scale(2.8,2.8);
transform: scale(2.8,2.8);
}
</style>
</head>
<body>
<div class="div">
<img src="https://cs.m.xczhihui.com/xcview/images/geren.jpg" alt="" class="img" />
</div>
</body>
</html>