Bootstrap Grid offset

In Bootstrap 5, the grid offset classes allow you to create space to the left of a column. This is helpful for centering columns, creating layouts with spacing, or just moving columns to a specific position in the row. 

Example
<div class="row">
<div class="col-4 offset-4" style="background:pink">Responsive Column</div>
<div class="col-4" style="background:green">Responsive Column</div>
<div class="col-4" style="background:pink">Responsive Column</div>
</div>

Try it yourself

Responsive Offset:

Here, the offset changes based on the screen size:

  • On medium screens (md), it offsets by 2 columns.
  • On large screens (lg), it offsets by 4 columns.
Example
<div class="row">
<div class="col-4 offset-md-2 offset-lg-4" style="background:pink">Responsive Column</div>
<div class="col-4" style="background:green">Responsive Column</div>
<div class="col-4" style="background:pink">Responsive Column</div>
</div>

Try it yourself


Whereisstuff is simple learing platform for beginer to advance level to improve there skills in technologies.we will provide all material free of cost.you can write a code in runkit workspace and we provide some extrac features also, you agree to have read and accepted our terms of use, cookie and privacy policy.
© Copyright 2024 www.whereisstuff.com. All rights reserved. Developed by whereisstuff Tech.