offset-md-3 do in Bootstrap?offset-md-3 to a column?The offset-md-3 class adds a left margin equal to 3 columns width on medium (≥768px) screens and larger. This shifts the column to the right by 3 columns, creating empty space before it.
The correct syntax for offsetting columns in Bootstrap 4 and 5 is offset-{breakpoint}-{number}. So offset-lg-4 moves the column 4 columns to the right on large screens.
<div class="row"> <div class="col-md-4 offset-md-4">Centered Column</div> </div>
What will you see on a medium screen (≥768px)?
<div class="row"> <div class="col-md-4 offset-md-4">Centered Column</div> </div>
The col-md-4 offset-md-4 sets the column to 4 columns wide with a left margin of 4 columns on medium screens. In a 12-column grid, this positions the column from column 5 to 8, leaving 4 columns empty on the left and 4 on the right, centering it horizontally.
offset-md-3). Which selector correctly targets these columns?The attribute selector [class*='offset-'] matches any element with a class containing the substring 'offset-'. This works for all offset classes like offset-md-3, offset-lg-2, etc.
Offset columns create visual spacing but do not convey semantic meaning. Adding aria-label to the column can help screen reader users understand the column's role or position if relevant. Empty divs or hiding elements can confuse users.