我正在使用引导程序4,并在下面提供了代码,我尝试将放置在其中的任何图像的位置调整到我自己的限度。因此,我尝试在CSS文档中使用“对象适合”属性。但这根本不起作用,我还能有其他解决方案吗?
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block w-100 cover" src="assets/images/cover_1.jpg" alt="First slide">
<div class="carousel-caption">
<h5>This is cover 1</h5>
<p>and this is the captions</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="assets/images/image2.png" alt="Second slide">
<div class="carousel-caption d-block d-md-block out">
<h5>This is cover </h5>
<p>and this is the caption</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="assets/images/cover_3.jpg" alt="Third slide">
<div class="carousel-caption d-block d-md-block">
<h5>This is cover </h5>
<p>and this is the caption</p>
</div>
</div>
</div>
在类 .carousel-inner 中,我放置了 object-fit:cover ,但是它对我的图像没有任何作用