Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Images not resizing (default Bootstrap classes only)

I am using Bootstrap 3.0 dist and I am following some Bootstrap tutorial now, trying to learn how it works. I did everything exactly as in the tutorial (it is for v2, so I changed the classes to v3) and I do not use any custom CSS or anything and in the tutorial the images resize when you simply resize the window, but in mine it stays same and wrecks everything. Also according to the tutorial images should stay centered inside the boxes (the 3 images).

like image 772
user13176 Avatar asked Sep 12 '13 12:09

user13176


People also ask

How do I change the size of an image in Bootstrap?

The OTHER answer is the best one, simply adding class="img-responsive" to the img tag does the trick! better from width:100%; is max-width:100%; and better all them is class img-responsive in BS3 or img-fluid in BS4. – Nabi K.A.Z.

What is IMG-responsive class?

img-responsive class: Responsive images in Bootstrap are created by adding . img-responsive class to img tag. An img-responsive class applies: max-width: 100% | height:auto | display:block onto the image.

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.


2 Answers

In bootstrap 3 Images are no longer responsive by default. Use .img-responsive for fluid size.

Doc:http://getbootstrap.com/getting-started/#migration-dropped

like image 73
ashwinm Avatar answered Sep 17 '22 13:09

ashwinm


Have you tried adding class="img-responsive" to the problematic images?

like image 38
CeeGee Avatar answered Sep 18 '22 13:09

CeeGee