Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No img-responsive in Bootstrap 4

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??

like image 219
Vahid Amiri Avatar asked Jan 15 '16 12:01

Vahid Amiri


People also ask

How do you make image responsive using Bootstrap?

To make an image responsive in Bootstrap, add a class . img-responsive to the <img> tag. This class applies max-width: 100%; and height: auto; to the image so that it scales nicely to the parent element.

What is IMG-responsive in Bootstrap?

Responsive images automatically adjust to fit the size of the screen. Create responsive images by adding an . img-responsive class to the <img> tag. The image will then scale nicely to the parent element.

Which Bootstrap 4 class is used to make images responsive?

img-responsive class is used for making images responsive as compared to img-fluid in Bootstrap 4.

How do I make my image fully responsive?

To make an image responsive, you need to give a new value to its width property. Then the height of the image will adjust itself automatically. The important thing to know is that you should always use relative units for the width property like percentage, rather than absolute ones like pixels.


3 Answers

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.

like image 101
Boxiom Avatar answered Oct 09 '22 07:10

Boxiom


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
like image 22
Tahir77667 Avatar answered Oct 09 '22 07:10

Tahir77667


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/

like image 5
Arnab Chakraborty Avatar answered Oct 09 '22 06:10

Arnab Chakraborty