I have a 1905px wide image and I was hoping to make it auto resize to fit the width read by bootstrap. This doesn't seem to work :
<div class="body container-fluid">
<div class="row">
<div class="col-md-12 col-lg-12 col-sm-12">
<img src="~/Content/Images/Temp/WP_20140326_001.jpg" />
</div>
</div>
</div>
Do I have to use css width ? Thank you !
Bootstrap has a helper class to help images to be responsive:
.img-responsive
Which, entails practically the same as Ken's answer:
.img-responsive,
.thumbnail > img,
.thumbnail a > img,
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
}
.img-responsive
.row > div > img { width: 100%; display: block; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With