Images not resized based on Bootstrap column size
css, image, twitter-bootstrap, twitter-bootstrap-3
Solution
Try adding this to your stylesheet:
img {
width: 100%;
}
Update: As an alternative (as pointed out in this answer's comments by @JasonAller), you could add `class="img-responsive"` to each `img` element. This applies `max-width: 100%;` and `height: auto;` to the image so that it scales nicely to the parent element. See the Bootstrap docs for more info.
update for bootstrap v4
The classname for bootstrap v4 is `img-fluid` Bootstrap v4 docs
Problem
My goal is to display 4 images per row. Code below: ``` <div class="row"> <div class="col-md-3 col-sm-4 col-xs-6"> <a href="{site_url}scents/baobab/pearls/black-pearls"><img src="{site_url}images/products/4906_1.jpg"></a> </div> <div class="col-md-3 col-sm-4 col-xs-6"> <a href="{site_url}scents/baobab/pearls/black-pearls"><img src="{site_url}images/products/4906_1.jpg"></a> </div> <div class="col-md-3 col-sm-4 col-xs-6"> <a href="{site_url}scents/baobab/pearls/black-pearls"><img src="{site_url}images/products/4906_1.jpg"></a> </div> <div class="col-md-3 col-sm-4 col-xs-6"> <a href="{site_url}scents/baobab/pearls/black-pearls"><img src="{site_url}images/products/4906_1.jpg"></a> </div> </div> ``` And I expect too see images resized based on column style from Bootstrap, but what I'm getting are overlapping full images . Any clue what is going on?