How do you show or hide elements on different screen sizes in Bootstrap?
<div class="d-none d-md-block bg-success-subtle p-2 mb-2">Visible from md and up</div>
<div class="d-block d-md-none bg-warning-subtle p-2">Visible only below md</div>
Live preview
Combine d-none with d-{breakpoint}-block (or inline, flex) to show an element from that size. See Utilities.
Learn more about the similar topics:
| Tutorials |
|---|
| Bootstrap Spacing: Margin, Padding and Gap |
| Bootstrap Flex Utilities |
| Bootstrap Utilities |
| Exercises & Assignments |
|---|
| Center a box horizontally and vertically with flex utilities |