Toggle visibility with hidden, block, flex, and responsive pairs like md:flex + md:hidden. Classic pattern: hamburger visible on mobile, horizontal nav on desktop.
Accessibility caution
Hiding with display:none removes content from the tab order. Mobile menus need keyboard focus traps and aria-expanded—utilities handle visuals, not behavior. Compare Utility CSS hide/show patterns.
Self-check
- Write classes for a nav hidden on mobile, flex on md+.
- What is missing if you only toggle
hiddenwithout JS for a menu?