title: bootstrap carousel image height
body: <p>i'm having some problems with the images in bootstrap v4 image carousel. If i scale down the browser width the height of image stays the same but the width of image getting smaller so the image gets very stretched out on the height.</p>
  
  <p>I have been looking at similar threads here on stackoverflow and tried everything i found in the comments but it still does not work. So i decided to make a new thread about this.</p>
  
  <p>Here is a codepen link <a href="https://codepen.io/anon/pen/owNyyx" rel="nofollow noreferrer">https://codepen.io/anon/pen/owNyyx</a> but i paste the code here too if you do not wish to visit codepen :)</p>
  
  <p>So here is the code i have</p>
  
  <pre><code>&lt;div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"&gt;
    &lt;ol class="carousel-indicators"&gt;
      &lt;li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"&gt;&lt;/li&gt;
      &lt;li data-target="#carouselExampleIndicators" data-slide-to="1"&gt;&lt;/li&gt;
      &lt;li data-target="#carouselExampleIndicators" data-slide-to="2"&gt;&lt;/li&gt;
    &lt;/ol&gt;
    &lt;div class="carousel-inner" role="listbox"&gt;
      &lt;div class="carousel-item active"&gt;
        &lt;img class="d-block img-fluid" src="images/image1.png" alt="First slide"&gt;
        &lt;div class="carousel-caption d-none d-md-block"&gt;
          &lt;h3&gt;Random Title for image1&lt;/h3&gt;
          &lt;p&gt;Random description1&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="carousel-item"&gt;
        &lt;img class="d-block img-fluid" src="images/image2.png" alt="Second slide"&gt;
        &lt;div class="carousel-caption d-none d-md-block"&gt;
          &lt;h3&gt;Random title for image2&lt;/h3&gt;
          &lt;p&gt;Random description2&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="carousel-item"&gt;
        &lt;img class="d-block img-fluid" src="images/image3.png" alt="Third slide"&gt;
        &lt;div class="carousel-caption d-none d-md-block"&gt;
          &lt;h3&gt;Random title for image3&lt;/h3&gt;
          &lt;p&gt;Random description3&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"&gt;
      &lt;span class="carousel-control-prev-icon" aria-hidden="true"&gt;&lt;/span&gt;
      &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
    &lt;/a&gt;
    &lt;a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"&gt;
      &lt;span class="carousel-control-next-icon" aria-hidden="true"&gt;&lt;/span&gt;
      &lt;span class="sr-only"&gt;Next&lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>