No img-responsive in Bootstrap 4

ImageTwitter Bootstrap

Image Problem Overview


I just downloaded the source code for Bootstrap 4 alpha 2 and can't find the class img-responsive in it. It exists in Bootstrap 3 source code and I can find it with Notepad++ but in Bootstrap 4s bootstrap.css in dist folder it doesn't exist.

What happend to it??

Image Solutions


Solution 1 - Image

From the Bootstrap 4 documentation:

> Images in Bootstrap are made responsive with .img-fluid. max-width: 100%; and height: auto; are applied to the image so that it scales with the parent element.

Solution 2 - Image

Bootstrap 3: .img-responsive

Bootstrap 4: .img-fluid

As in Bootstrap 4 Images:

> Images in Bootstrap 4 are made responsive with .img-fluid. max-width: > 100%; and height: auto; are applied to the image so that it scales > with the parent element.

<img class="img-fluid" src="" alt=""> //This will make your image responsive

Solution 3 - Image

It seems you need to use a new class img-fluid instead of img-responsive if you are using Bootstrap 4 alpha 2. Have a look at : http://v4-alpha.getbootstrap.com/content/images/

Solution 4 - Image

Use img-fluid class instead of img-responsive

see docs

Solution 5 - Image

In Bootstrap 4 you can use class="img-fluid".

This is the explaination:

Images in Bootstrap are made responsive with .img-fluid. max-width: 100%; and height: >auto; are applied to the image so that it scales with the parent element.

This is the code as suggested: <img src="..." class="img-fluid" alt="Responsive image">

Solution 6 - Image

Boostrap 4 is using .img-fluid class.

For more references Boostrap changes for image

Solution 7 - Image

You can also use .img-thumbnail that is the same of .img-fluid but also give an image a rounded 1px border appearance.

Look the result: Image thumbnails

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVahid AmiriView Question on Stackoverflow
Solution 1 - ImageBoxiomView Answer on Stackoverflow
Solution 2 - ImageTahir77667View Answer on Stackoverflow
Solution 3 - ImageArnab ChakrabortyView Answer on Stackoverflow
Solution 4 - ImageAbdul BasitView Answer on Stackoverflow
Solution 5 - ImageMuhammadim Yusoff JamaluddinView Answer on Stackoverflow
Solution 6 - ImageAnand RajaView Answer on Stackoverflow
Solution 7 - Imagealvaro fvrView Answer on Stackoverflow