"Flexbox"
Bootstrap 4.1.1 Snippet by ranjit1602

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="card-container"> <div class="card"> <img src="image1.jpg" alt="Card 1"> <h2>Card 1</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </div> <div class="card"> <img src="image2.jpg" alt="Card 1"> <h2>Card 2</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </div> <div class="card"> <img src="image3.jpg" alt="Card 1"> <h2>Card 3</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </div> <!-- Repeat the card structure for more items --> </div>
/* styles.css */ .card-container { display: flex; flex-wrap: wrap; justify-content: space-between; word-wrap: break-word; } .card { width: 150px; margin-bottom: 20px; border: 1px solid #ccc; padding: 20px; text-align: center; }

Related: See More


Questions / Comments: