我的轮播代码与get bootstrap网站的代码基本相同。图片大小相同。
<div class="carousel-item">
<img class="d-block img-fluid" src="https://i.imgur.com/WBYXYze.jpg" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
我的css
.carousel-inner > .item > img, .carousel-inner > .item > a > img {
background:linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.7))
}
添加此css不会对图像产生任何影响,并且控制台上没有错误。