Control layout participation with d-none, d-block, d-flex, and responsive pairs like d-md-none d-lg-block. Classic pattern: show toggler on mobile, horizontal nav on desktop.
Visibility vs display
d-none— removes from layout (display: none)invisible— hides visually but keeps layout spacevisually-hidden— screen-reader-only text (skip links, labels)
Important interview questions and answers
- Q: d-none vs invisible?
A:d-noneremoves the box from flow;invisiblekeeps space—likevisibility: hidden. - Q: Accessibility when hiding nav?
A: Collapsed mobile menus should still be keyboard reachable when open; display utilities alone do not implement focus traps.
Self-check
- Which utility hides an element but preserves its space?
- Write classes to hide on md and show on lg.