我有一个div,其背景图像在我的样式表中定义如下:
.information_photo {
position: relative;
top: 30px;
width: 100%;
height: 200px;
background-image: url('http://www.ladyblitz.it/wp-content/uploads/2015/04/carbonara.jpg');
background-repeat: no-repeat;
background-position: center center;
background-size: 100% 100%;
}
<div class="information_photo"></div>
如您所见,它拉伸了原始图像,而我只想让它专注于背景图像的某一部分,而不会拉伸或调整大小。