Media queries are the CSS mechanism for responsive design — but the actual design thinking underneath it is about content and priority, not just breakpoints. What should disappear, reflow, or become the main focus as screen size shrinks is a design decision, not something CSS decides for you.
3 min read
The CSS & Modern Styling domain covers how media queries and flexible layouts actually work in CSS. This lesson is about the design thinking that decides what should happen at each size — which content matters most on a small screen, what can be hidden or deprioritized, and how interaction itself changes between a mouse-driven desktop and a touch-driven phone. Two screens built with identical CSS techniques can have very different real usability depending on these upstream decisions.
Mobile-first design means designing (and building) the small-screen layout first, then progressively adding complexity and additional content for larger screens — the opposite order from designing a full desktop layout first and then trying to cram it down to fit a phone. Starting from the most constrained case forces genuinely necessary prioritization from the very beginning: on a small screen, there's no room to hide the fact that ten equally-weighted navigation items don't actually all matter equally.
A practical exercise: list every piece of content and every action on a screen, then rank them by actual importance to the task at hand. The highest-priority items should remain visible and usable at every screen size; lower-priority items can reasonably be hidden behind a menu, moved below the fold, or dropped from the smallest breakpoint entirely. Skipping this exercise often results in a small-screen layout that either arbitrarily hides something genuinely important, or keeps everything visible at a size too cramped to use any of it comfortably.
A mouse interaction can detect hover (revealing a tooltip, a dropdown, a secondary action on mouseover) — touch fundamentally cannot, since there's no cursor lingering over an element before a tap commits to it. A design that relies on hover to reveal necessary functionality (a menu that only appears on hover, with no tap-triggered equivalent) simply doesn't work on touch devices at all — this needs an explicit fallback, not just smaller versions of the same hover-dependent interactions.
Simply scaling every element down proportionally as the screen narrows usually produces cramped, hard-to-use results rather than a good small-screen experience. Real responsive design typically reflows — a three-column layout becomes a single column with items stacked vertically, a horizontal navigation bar becomes a bottom nav or a hamburger menu, a data table becomes a stacked list of cards. The content adapts its actual structure to the available space, not just its size.
A quick resize of a desktop browser window approximates a mobile layout but misses real device differences: actual touch behavior, real device pixel density, and how content genuinely looks at a true small physical size rather than a shrunk browser window. Testing on (or at minimum accurately emulating) real target device sizes catches problems a simple browser resize won't.
Check your understanding
A quick comprehension check — not tracked, not graded, just for you.
1. What does 'mobile-first' design mean, and why is it valuable?
2. Why doesn't a design relying on hover to reveal important functionality work on touch devices?
3. What does 'reflow' mean in the context of responsive design?
UI/UX for Developers