title: How to give bootstrap 3.0 carousel item a height of auto
body: <p>I'm trying to make the images inside bootstrap carousel responsive in terms of height first, width second. This is because the images I'm adding to the carousel are for the most part of larger height than width although I should write the css where it will look the same regardless of the image dimensions.</p>
  
  <p>I am overriding the class on my styles rather than modifying the bootstrap stylesheet because I prefer to load bootstrap using  CDN.</p>
  
  <p>The class I'm adding to my style is </p>
  
  <pre><code>.carousel-inner &gt; .item &gt; img {
      position: absolute;
      top: 0px;
      left: 0px;
      height: auto;
      max-width: 100%;
  }
  </code></pre>
  
  <p>The height: auto and max-width: 100% works great. The problem I run into is that the .carousel .item has a height of 500px. bootstrap.css line 49.</p>
  
  <pre><code>.carousel .item {
      height: 500px;
      background-color: #777;
  }
  </code></pre>
  
  <p>I can't give the class shown above a height of auto because the image then is not visible. If I leave it as such, images with a height over 500px get cut off, images smaller will make the carousel seem out of proportion.</p>
  
  <p>Any help on this will be greatly appreciated. Thanks in advance.</p>