1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <div class="pic"><img src="ttt.jpg"></div>
.pic {
width:182px; height:277px; display: flex; justify-content: center; align-items: center;
img { //width: 100%; //height: 4.61333rem;
width: 100%; height: 100%; object-fit:cover; /*object-fit:none;*/ //none则不改变图片原始尺寸 } }
|