What is the correct way to use Bootstrap grid with images? Pending Review
Asked on Sep 16, 2025
1 Answer
Bootstrap's grid system allows you to create responsive layouts easily. When using images, you can utilize the grid to ensure they are responsive and aligned properly. Here's a basic example of using Bootstrap's grid system with images.
<!-- BEGIN COPY / PASTE -->
<div class="container">
<div class="row">
<div class="col-md-4">
<img src="image1.jpg" class="img-fluid" alt="Responsive image">
</div>
<div class="col-md-4">
<img src="image2.jpg" class="img-fluid" alt="Responsive image">
</div>
<div class="col-md-4">
<img src="image3.jpg" class="img-fluid" alt="Responsive image">
</div>
</div>
</div>
<!-- END COPY / PASTE -->
- The
container
class centers your content and adds padding. - The
row
class creates a horizontal group of columns. - The
col-md-4
class specifies that each column should take up 4 out of 12 grid spaces on medium and larger screens. - The
img-fluid
class makes the image responsive, scaling it nicely to the parent element.