If you use the IMG tag, it will always be larger than its DIV container. Because bootstrap resizes fixed images to fit liquids, especially on mobile devices, the images are curled to the width of the screen.
An alternative that seems to work so far for me is to use a <div> tag with a background image.
Grade:
.carousel-inner > .item > .carousel-image { width: 100%; height: 500px; text-align: center; align: center; }
Product code:
#csl-item1 { background:url(img/carousel_image1.jpg); background-repeat: no-repeat; background-position: center top; }
Paragraph:
<div class="item active"> <div id="csl-item1" class="carousel-image"> </div> <div class="container"> <div class="carousel-caption"> </div> </div> </div>
I would be interested to know if anyone has errors with this tho method, so let me know if you think this is a bad idea ...
source share