How to Get Responsive Design Right
Building one page that adapts its layout, type and images to the viewport it is being read on, rather than maintaining separate mobile and desktop sites.
On this page
What is at stake
Mobile is the majority of traffic on most sites and the version Google indexes, so a layout that only works at desktop width is a layout that only works for the minority of readers and none of the crawlers that matter.
The playbook
- Design the narrow layout first, because it forces the content hierarchy to be decided rather than inherited
- Set breakpoints from where the design stops working, not from a list of phone models
- Use container queries for components that appear in more than one column width
- Serve appropriately sized images with srcset and sizes rather than one file scaled by CSS
- Test with the browser zoomed to 200 per cent as well as at narrow widths
Where it goes wrong
Avoid:
- Hiding content on mobile that desktop visitors get, which changes what is indexed
- Fixed pixel widths on anything that holds text
- Disabling zoom with user-scalable=no, which breaks the page for anyone who needs to magnify it
- Treating tablet as an afterthought between two designs that were made properly
The numbers behind it
| Measure | Figure |
|---|---|
| What Google indexes | the mobile version of the page, under mobile-first indexing |
| Common breakpoint practice | set breakpoints where the content breaks, not at named device widths |
| Minimum target size, WCAG 2.2 AA | 24 by 24 CSS pixels |
| Viewport meta requirement | width=device-width, initial-scale=1 |
| Modern layout primitives | flexbox, grid, container queries and clamp() for fluid type |
Getting outside help
When to hand it over: Bring in help when the mobile and desktop versions have drifted into different content, when a rebuild keeps regressing at particular widths, or when a legacy template cannot be made responsive without replacing it.
Where this comes from
- MDN Web Docs — Responsive design
- Google Search Central — Mobile-first indexing
- web.dev — Responsive web design basics
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.