图片正中位于div正中,超出部分隐藏(效果为宽高等比例填充满整个div)。 img {margin: 0; padding: 0; width: 100%; height: 100%; object-fit: cover;}