84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
.img{ width:100px; max-height:100px; overflow:hidden; } .img img{ width:100%; height:100%; }
我想让任何图片都显示大小为宽度为100px;最大高度为100px;但是默认情况下的截取都是从左上角截取的,怎么让这个图片从中间截取的呢?
ringa_lee
background:url() center no-repeat试试
background:url() center no-repeat
实现方式还是挺多的,可以利用background,然后background-position去居中也可以在p设置overflow:hidden,然后img用绝对定位去居中
background:url() center no-repeat
试试实现方式还是挺多的,可以利用background,然后background-position去居中
也可以在p设置overflow:hidden,然后img用绝对定位去居中