Stretch image to fit full container width bootstrap

In bootstrap 4.1, the w-100 class is required along with img-fluid for images smaller than the page to be stretched:

<div class="container">
  <div class="row">
    <img class="img-fluid w-100" src="#" alt="" />

see closed issue:

(As of 2018-04-20, the documentation is wrong: says that img-fluid applies max-width: 100%; height: auto;” but img-fluid does not resolve the issue, and neither does manually adding those style attributes with or without bootstrap classes on the img tag.)

Leave a Comment