Responsive design is an approach where one page adapts its layout to any screen size. Learn the CSS techniques, the viewport tag and how to test it.

On this page
Summary
Responsive design is a way to build a website so that one set of HTML and CSS adapts its layout to any screen size, from a phone to a desktop monitor. Instead of building separate mobile and desktop sites, the page uses fluid grids, flexible images and media queries to rearrange its content as the screen changes.
Want to go further? Ask
Responsive design is the layout approach Google recommends for mobile-friendly sites. The same URL serves the same HTML on every device, and CSS decides how that content is arranged. A menu can become a row of links on a laptop and a single button on a phone, with no second site to maintain. The term was coined by Ethan Marcotte in 2010, as MDN Web Docs explains.
It rests on three building blocks. Each one solves a different part of the layout problem, and most real sites use all three together.
Together they let one stylesheet handle every screen. You do not need a separate template for each device, and you can change the layout later by editing the CSS once.
Mobile browsers need one line of HTML to use the real width of the phone. Without it, many browsers draw the page at a desktop width and shrink it to fit, so your media queries may never trigger. The web.dev guide to responsive design basics recommends including this tag on every page.
<meta name="viewport" content="width=device-width, initial-scale=1">

Tip
Check the layout on a real phone when you can. Browser emulators help, but they do not always show how a phone handles zoom and touch.
A media query checks a condition, most often the width of the browser window, and applies CSS only when that condition is true. The width where the layout changes is called a breakpoint. MDN Web Docs recommends a mobile-first approach: write the single-column layout first, then add columns at wider breakpoints.
.wrapper {
display: block;
}
@media screen and (width >= 600px) {
.wrapper {
display: flex;
}
}
Define breakpoints in relative units such as rem or em where you can, so text size and spacing follow the reader's settings. Media queries are not always required, since flexible grids and min or max values can handle many layouts on their own.

Most responsive layouts combine the techniques below. Pick the one that fits the job, not the one that is newest.
| Technique | What it controls | Typical use |
|---|---|---|
| Flexbox | Items in one row or one column | Navigation bars, rows of cards |
| CSS Grid | Rows and columns together | Page layouts, galleries |
| Media queries | Rules that change at a given width | Switching from one column to three |
| Relative units (%, rem, em) | Sizes that scale with the text or the container | Widths, spacing, font sizes |
| max-width: 100% | Stops images and videos from overflowing | Photos, embedded videos |
Set max-width: 100% on images, videos and embeds, so they shrink to fit but never grow beyond their container. Also set the width and height attributes, so the browser reserves the space before the file loads. This reduces layout shifts, which are part of Core Web Vitals, the speed and stability scores Google uses to judge page experience.
img,
picture,
video {
max-width: 100%;
height: auto;
}
For large photos, image optimization covers the file formats and sizes that keep phones fast. To serve a smaller file to small screens, MDN describes the srcset and sizes attributes.
Google Search Central describes responsive design as serving the same HTML on the same URL to every device, while the content can be displayed differently based on screen size. It also says Google recommends this setup because it is the easiest design pattern to implement and maintain. Under mobile-first indexing, Google uses the mobile version of your content as the main version for indexing, so a page that breaks on phones can lose ground even in desktop results.
Speed belongs in the same review. Heavy images and scripts slow a page down most on phones, so check your page speed alongside the layout.
Test on at least two screen sizes, then check speed for both. The steps below cover the checks that matter most.
These four errors show up often. Check for each one before you publish.
The page has no viewport meta tag, so a phone shows a zoomed-out desktop layout with tiny text. You spot it when media queries never change anything on a phone. Fix it by adding the tag from the viewport section to the head of every template.
Containers, tables or images have a set width, such as 900px. You spot it when a horizontal scrollbar appears on a phone. Fix it with percentages, max-width or a fluid grid, so the element can shrink.
The tag includes maximum-scale, minimum-scale or user-scalable. You spot it when pinch-to-zoom does nothing on a phone. Fix it by removing those parameters, because web.dev advises against them: they can block zooming and hurt accessibility.
Font sizes use only a unit such as vw, so the text does not scale well when the reader zooms. You spot it by enlarging the text in your browser and seeing that the layout breaks or the text barely grows. Fix it by combining a fixed unit with a viewport unit, for example calc(1.5rem + 4vw), as MDN suggests.
A responsive page has one URL and one HTML version, so there is one page to write, check and maintain. Search engines read the same content that visitors see, and that keeps your message consistent across devices. Because Google indexes the mobile version of your content, the layout that works on a phone is the one that counts. For the ranking side of phones, read the Mobile SEO guide to ranking on smartphones. This page covers the layout code, while that guide covers search results. If you want the bigger picture, the user experience entry explains how layout ties into rankings and AI visibility.
Responsive design gives you one page that works on every screen, built with fluid grids, flexible images, media queries and a viewport tag. Start with the viewport tag, then test your main templates on a phone and a laptop. Fix fixed widths and blocked zoom first, because those cause the most visible damage.
Sources
Not quite. Responsive design is one way to be mobile-friendly, and it is the approach Google recommends. A responsive layout works well on a phone without requiring a second site to maintain.
Yes. Without it, many phones show the page at desktop width and zoom it out, so your media queries may never run. Add width=device-width and initial-scale=1 in the head of every page.
It helps indirectly. Google recommends responsive design, and under mobile-first indexing it uses the mobile version of your content to index and rank pages. A layout that works on phones protects the version Google reads.
