Can you help me understand why the background-image
increases in size vertically when transitioning from url/path
to url/path2
? I need it to stay the same size as it toggles through all the images.
What mistake am I making and how can I correct it?
Snippet
$('.carousel').carousel({
interval: 2000
})
.topSection {
padding-top: 20px;
background-image: url("https://i.stack.imgur.com/owXXD.jpg");
max-width: 100%;
max-height: 100%;
position: fixed;
}
img {
vertical-align: middle;
border-style: none;
width: 17em;
margin: 5em;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<div class="container topSection">
<div id="carouselExampleSlidesOnly" class="carousel slide row" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active col-6">
<img class="d-block w-10" src="https://i.stack.imgur.com/j0J5g.png" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-10" src="https://i.stack.imgur.com/1pzi6.jpg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-10" src="https://i.stack.imgur.com/1pzi6.jpg" alt="Third slide">
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>