BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
User Experience

Responsive design: One layout for every screen

Responsive design serves the same HTML at the same URL to every device and lets CSS adapt the layout to the screen. It's the setup Google recommends.

Monthly searches · responsive design
550.0k
Keyword research data
responsive design
Responsive design: One layout for every screen
Click the image to view it full size

Responsive design (or responsive web design, RWD) is a way of building pages so that one set of HTML, at one URL, works on every screen. The browser gets the same page on a phone, a tablet or a wide monitor, and the CSS rearranges it to fit: one column on a phone, two or three on a laptop, images that shrink with their column.

Ethan Marcotte named the idea in an article called "Responsive Web Design" in A List Apart on May 25, 2010. He described three technical ingredients: fluid grids, flexible images and media queries. Those three are still the core, although CSS has since gained tools that make the job easier.

How a responsive page works

The viewport tag comes first. Without it, many mobile browsers lay the page out in a virtual window about as wide as a desktop screen (MDN's example is 980 pixels) and then shrink it. Your phone-sized styles never apply. One line in the <head> fixes that:

<meta name="viewport" content="width=device-width, initial-scale=1">

Don't add user-scalable=no or a low maximum-scale. Blocking zoom makes pages hard to read for people with low vision. See viewport.

Then a fluid layout. Widths are relative (percentages, fr units in CSS Grid, flexible items in Flexbox), so the layout stretches and shrinks with the screen instead of being fixed at one pixel width.

Flexible images and video. A rule such as img { max-width: 100%; height: auto; } keeps media inside its column. To send smaller files to smaller screens too, use responsive images.

Media queries change the layout at breakpoints. A media query applies styles only when a condition is true, usually a minimum width:

.cards { display: grid; gap: 1rem; }

@media (min-width: 48em) {
  .cards { grid-template-columns: 1fr 1fr; }
}

This example is written mobile first: the plain styles are for small screens, and the query adds columns when there's room. Put breakpoints where your content starts to look cramped or stretched, not at the width of a particular phone.

Container queries go one step further. They style a component by the size of the box it sits in, not the size of the screen. A product card can switch to a horizontal layout whenever its container is wide enough, wherever on the page it appears.

Responsive, adaptive and separate mobile sites

Google describes three ways to serve mobile visitors:

Setup What the server does What it takes
Responsive design Same HTML, same URL for every device; CSS adapts the layout One page to maintain
Dynamic serving Same URL, but different HTML depending on the user agent User-agent detection and a Vary: User-Agent header
Separate URLs (m-dot sites) Different HTML on different URLs, such as m.example.com Detection, redirects and annotations linking each pair of pages

"Adaptive design" usually means a set of fixed layouts for device classes, served by one of the last two setups or chosen by CSS. Google recommends responsive design, because it's the easiest to implement and maintain. Google Search Central

What responsive design means for SEO

Google indexes the mobile version. Google crawls with a smartphone crawler and uses the mobile version of a page for indexing and ranking, called mobile-first indexing. It announced in October 2023 that the switch is complete. With a responsive site the mobile and desktop versions are the same HTML, so there's nothing to keep in sync. With the other two setups, every page needs the same content, headings, structured data and robots meta tags on both versions.

Content left out of the mobile page is left out of Google. If a mobile template drops a section, or a script only loads it after a tap or swipe, Google may never see it. Collapsing content into accordions or tabs is fine, as long as it's in the HTML.

Mobile display is part of page experience, not a ranking boost of its own. Google's page experience self-assessment asks whether your content displays well on mobile devices. But of the page experience aspects, Google names only Core Web Vitals as used by its ranking systems; the others, it says, don't directly help a site rank higher, though they make it more satisfying to use, which is what its ranking systems seek to reward. Google Search Central The visitor on a phone is the real reason to get it right.

Let Google load your CSS and scripts. If robots.txt blocks your stylesheets, Google can't render the page the way visitors see it.

How to check a responsive page

Google's Mobile-Friendly Test and the Search Console Mobile Usability report were retired on December 1, 2023. Use these instead:

  • your browser's device mode in its developer tools, dragging the width from narrow to wide and watching for overflow, tiny text and crowded buttons,
  • Lighthouse in Chrome, which Google points to for mobile usability,
  • a real phone, for touch targets and anything that only appears on tap,
  • a live test in Search Console's URL Inspection tool, which shows a screenshot of the page as Google's testing crawler renders it.

Common mistakes

  • No viewport tag, so phones show a shrunken desktop page.
  • Fixed widths on a container, table or embed that force sideways scrolling.
  • Breakpoints for specific devices instead of for the content, which break on the next screen size.
  • Leaving content out of the mobile page to tidy the layout, which leaves it out of Google's view too.
  • Full-size desktop images on phones. The layout fits, but visitors download pixels they never see. See mobile optimization for the rest of the phone experience.
Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.