content
content
content
content
The example above demonstrates how to create responsive columns with Bootstrap.
<div class="container">
<div class="row">
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<p class="demo-content demo-content-1">content</p>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<p class="demo-content demo-content-2">content</p>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<p class="demo-content demo-content-3">content</p>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-3">
<p class="demo-content demo-content-4">content</p>
</div>
</div>
</div>
col-12
: This makes the column take up the full width (12 columns) on extra small devices (phones).col-sm-6
: On small devices (≥576px), the column takes up 6 out of 12 columns (50% width).col-md-4
: On medium devices (≥768px), the column takes up 4 out of 12 columns (33.33% width).col-lg-3
: On large devices (≥992px), the column takes up 3 out of 12 columns (25% width).col-xs
, col-sm
, col-md
, col-lg
, col-xl
).For example:
col-sm-4
: This will take up 4 columns on small screens (small tablets and above).col-lg-6
: This will take up 6 columns (50%) on large screens.content
content
<div class="row">
<div class="col-md-6">
<p class="demo-content demo-content-1">content</p>
</div>
<div class="col-md-6">
<p class="demo-content demo-content-2">content</p>
</div>
</div>
content
content
content
<div class="row">
<div class="col-md-4">
<p class="demo-content demo-content-1">content</p>
</div>
<div class="col-md-4">
<p class="demo-content demo-content-2">content</p>
</div>
<div class="col-md-4">
<p class="demo-content demo-content-3">content</p>
</div>
</div>