我有一个全宽图像轮播,我的图像缩放不正确。图像的顶部和底部部分不可见,就像它们被切断一样,左右两侧正确对齐。
非常感谢任何建议:
HTML:
<div class="item active">
<!-- Set the first background image using inline CSS below. -->
<div class="fill" style="background-image:url('images/3.jpg');"></div>
<div class="carousel-caption">
<h2>Caption 1</h2>
</div>
</div>
CSS
.carousel {
height: 75%;
}
.item,
.active,
.carousel-inner {
height: 100%;
}
.fill {
width: 100%;
height: 100%;
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}