title: bootstrap img responsive height does not keep container height
body: <p>I have an image that want to be responsive to the container size.
  The parent container (cover-photo) has a height of 180px.
  The image has a height of 853px. However when using img-fluid, the image does not keep the container height of 180px instead it keeps its own height of 853px.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>              &lt;!doctype html&gt;
                &lt;html lang="en"&gt;
                  &lt;head&gt;
                    &lt;title&gt;Hello, world!&lt;/title&gt;
                    &lt;!-- Required meta tags --&gt;
                    &lt;meta charset="utf-8"&gt;
                    &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&gt;
  
                    &lt;!-- Bootstrap CSS --&gt;
                    &lt;link rel="stylesheet" href="css/bootstrap.min.css"&gt;
                 
  
                   &lt;style&gt;
                     .cover-photo {
                        height: 180px;
                      }
                     &lt;/style&gt;
                        
                  &lt;/head&gt;
                  &lt;body&gt;
                   &lt;div class="container-fluid"&gt;
  
                      &lt;div class="container"&gt;
                        &lt;div class="row"&gt;
                          &lt;div class="cover-photo"&gt;
                            &lt;img class="img-fluid" src="http://newlovewallpapers.in/images/hd-love-images-and-wallpaper/hd-love-images-and-wallpaper-11-1280.jpg" alt="Background profile"&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  
                    &lt;!-- Optional JavaScript --&gt;
                    &lt;!-- jQuery first, then Popper.js, then Bootstrap JS --&gt;
                    &lt;script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"&gt;&lt;/script&gt;
                    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"&gt;&lt;/script&gt;
                    &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
                    &lt;!-- &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"&gt;&lt;/script&gt; --&gt;
                    &lt;script src="js/parallax.js"&gt;&lt;/script&gt;
                  &lt;/body&gt;
                &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I understand that img-fluid in Bootstrap is max-width: 100%; and height: auto; and are applied to the image so that it scales with the parent element. But in this case it does not scale to the parent height.
  Any insights? Thanks!</p>