To achieve a card layout with columns in Bootstrap, you can utilize the .card-columns
class as shown in the example below:
https://getbootstrap.com/docs/4.0/components/card/#card-columns
If you need to manage the flow direction of items within the cards without altering their order in the markup, it may be necessary to use a library like Masonry for that purpose. You can find more information about Masonry at:
The CSS snippet provided below shows an example structure for creating regions and cities within the cards:
.region {
color:black;
padding-left: 0;
font-size: 14px;
font-weight: bold;
}
.city {
color: #304ffe;
padding: 0.25rem 0.25rem;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
</head>
<body>
<div class="col-md-12 col-lg-6 col-sm-12">
<div class="card">
<div class="card-header">
<strong>United States</strong>
</div>
<div class="card-body">
<div class="card-columns">
<!-- Cards with list groups for different regions and cities -->
</div>
</div>
</div>
</div>
</body>
</html>