-1

I am having trouble down scaling a responsive image in bootstrap using the example carousel on their website.

<div class="container"> 
        <div class="other-div">
        ....
        </div>
      <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
          <div class="carousel-inner img-fluid">
            <div class="carousel-item active">
              <img class="img-fluid" src="/path/1.jpg" alt="First slide">
            </div>
            <div class="carousel-item">
              <img class="img-fluid" src="/path/2.jpg" alt="Second slide">
            </div>
          </div>
          <a class="carousel-control-prev" href="#carouselExampleControls" 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="#carouselExampleControls" role="button" data-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
          </a>
        </div>

</div>

The images appears as follows:

elongated image

How the images should appear

The image is quite large around 3000x1500 px. I was hoping to scale it down to be the width of the container and an appropriate height to keep aspect ratio. ex 900/450.

jackana3
  • 27
  • 6

1 Answers1

0

The problem was that had to remove the class definitions for carousel-item and the animation elements because they were treating the imgs as flex elements. Added the following to my style.css:

.carousel-item{}

.carousel-item-next, .carousel-item-prev, .carousel-item.active
{
    display:block;
}
jackana3
  • 27
  • 6