In short
- Responsive web design means one website whose layout adapts to the width of the screen, instead of separate desktop and mobile sites.
- It rests on three things: layouts sized in proportions, images that scale and CSS rules that change the layout at certain widths.
- Google indexes the mobile version of a site, so a page that works badly on a phone is at a disadvantage in search.
- Modern CSS does much of the work without breakpoints: grid, flexbox,
clamp()and container queries let components adapt on their own. - Being responsive is more than fitting the screen. Text must be readable, buttons easy to tap and nothing should scroll sideways.
Almost every website is now opened on screens that range from a phone held in one hand to a monitor a metre wide. Responsive web design is the approach that lets a single website serve all of them: the same pages, the same content and the same address, with a layout that rearranges itself to suit the space available.
The term was coined by the designer Ethan Marcotte in 2010, when the usual answer to the first smartphones was a second, cut-down mobile site. Responsive design replaced that idea so completely that it is now simply how websites are built. This guide explains how it works, what has changed and how to tell whether a site does it well.
What Responsive Web Design Means
A responsive page is fluid. Its columns are defined as proportions of the screen, not fixed numbers of pixels, so they stretch and shrink with the window. At certain widths, called breakpoints, the layout changes more decisively: three columns become two and then one, a row of menu links collapses behind a menu button, a wide table turns into a stack of cards.
The content does not change. A visitor on a phone gets the same words, prices and pictures as a visitor on a laptop, arranged differently. That matters for two reasons. People switch between devices and expect to find the same things, and search engines look at one version of the page.
| Approach | How it works | Where it stands today |
|---|---|---|
| Responsive | One site and one set of pages. CSS rearranges the layout to fit the screen. | The standard for almost every website. |
| Adaptive | A handful of fixed layouts, with the server or the browser choosing the nearest one. | Occasionally used for complex applications. |
| Separate mobile site | A second site on its own address, often m.example.com, with reduced content. | Obsolete. It doubles the upkeep and splits your search presence. |
The Three Ingredients
Marcotte's original recipe had three parts, and it still describes the foundations.
- Fluid grids. Widths are set in relative units such as percentages,
frorrem, so the layout scales with the screen. - Flexible images. Images are told never to be wider than their container, so they shrink with it instead of spilling out.
- Media queries. CSS rules that apply only when a condition is met, most often a minimum or maximum width.
One line of HTML makes it all work on phones. Without the viewport tag, a mobile browser assumes the page was designed for a desktop screen and shrinks the whole thing to fit.
<meta name="viewport" content="width=device-width, initial-scale=1">img {
max-width: 100%;
height: auto;
}
.cards {
display: grid;
grid-template-columns: 1fr;
gap: 1.5rem;
}
@media (min-width: 48rem) {
.cards {
grid-template-columns: repeat(3, 1fr);
}
}How Responsive Design Has Moved On
For years, responsive design meant writing a media query for every awkward width. Modern CSS has made much of that unnecessary, because layouts can now work out for themselves how many columns fit.
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
gap: 1.5rem;
}
h1 {
font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
}The most significant change is the container query. A media query asks how wide the screen is. A container query asks how wide the box the component sits in is, which is usually the more useful question. A product card can then lay itself out one way in a narrow sidebar and another way in a wide main column, on the same page and the same screen. Container queries are supported in every current browser.
.card-wrapper {
container-type: inline-size;
}
@container (min-width: 30rem) {
.card {
display: grid;
grid-template-columns: 12rem 1fr;
}
}Our comparison of CSS grid and flexbox explains the two layout systems these examples use.
Why It Matters for Search and Sales
Google uses the mobile version of a page for indexing and ranking, a policy it calls mobile-first indexing. Since July 2024 it has crawled sites with its smartphone crawler only, and content that cannot be reached on a phone may not be indexed at all. A site that hides half its content on small screens, or that is awkward to use on one, is therefore being judged on its weakest version.
The commercial case is simpler still. A large share of visits to business websites come from phones, and for local services and restaurants it is often the majority. Someone who has to pinch, zoom and scroll sideways to find a phone number will find a competitor's instead. Our guide to getting a new website found on Google covers the other basics of search.
Responsive Is More Than Fitting the Screen
A page can technically fit a phone and still be miserable to use on one. The details below decide whether a responsive site is a good one.
- Readable text. Body text of at least 16 pixels, with lines that do not run the full width of a large screen. See our guide to web typography.
- Touch targets. Buttons and links large enough and far enough apart to tap accurately. The accessibility guidelines set a minimum of 24 by 24 CSS pixels, and around 44 is more comfortable.
- No hover-only content. There is no hover on a touch screen, so nothing essential should appear only when a mouse passes over it.
- Navigation that suits a thumb. A menu that works with one hand, as described in our guide to website navigation.
- Images sized for the device. A phone should not download a photograph large enough for a desktop monitor. Image optimisation covers how.
- Forms that bring up the right keyboard. An email field should show the email keyboard and a phone field the number pad.
How to Test a Responsive Website
- Open the site on your own phone and try to complete the main task, whether that is finding the phone number, making a booking or reading the prices.
- Turn the phone sideways. Landscape is where layouts most often break.
- In a desktop browser, drag the window slowly from wide to narrow and watch for the widths where things overlap, wrap badly or leave awkward gaps.
- Use the browser's device toolbar to check common sizes, but do not rely on it alone. It cannot reproduce touch, real fonts or a slow connection.
- Increase the text size in the browser settings and zoom to 200%. Nothing should be cut off or overlap.
- Run the page through PageSpeed Insights, which reports how it performs on a mobile connection.
Tip: Test the pages with the most awkward content, not just the home page. Price tables, long forms and anything with a wide image are where responsive layouts fail.
Common Responsive Design Mistakes
- Designing for three screen sizes. There are no standard widths any more. Set breakpoints where the content starts to look wrong, not at the size of a particular phone.
- Hiding content on mobile. If something is not worth showing on a phone, ask whether it is worth showing at all. Hidden content also risks being overlooked by search engines.
- Fixed widths and heights. A box given a height in pixels will overflow as soon as its text wraps onto another line.
- Horizontal scrolling. One element wider than the screen, often a table, an embedded map or a long web address, makes the whole page slide sideways.
- Disabling zoom. Some sites block pinch-to-zoom to protect a layout. It locks out people who need larger text.
- Treating mobile as an afterthought. Squeezing a finished desktop design onto a phone gives worse results than starting from the small screen, the approach described in our guide to mobile-first design.
Putting It Into Practice
Reading about a technique is the easy part. Applying it to a real business, with real content and a launch date, takes judgement about what to use and what to leave out. DigitalPod is a UK-based design and web development studio that designs every site from a blank page and builds it by hand, so a technique is used because it helps the business and not because a template came with it. If you would like a website designer to handle it for you, startup website design is what we specialise in, websites start from £2,400 and our website redesign service brings an older site up to date.
Frequently Asked Questions
What is responsive web design in simple terms?
It is a way of building a website so that one set of pages works on every size of screen. The layout rearranges itself to suit a phone, a tablet or a desktop monitor, while the content and the web address stay the same.
What is the difference between responsive and mobile-friendly?
Mobile-friendly is the result: a site that is easy to use on a phone. Responsive design is the usual way of achieving it. A responsive site can still be unfriendly on a phone if the text is tiny or the buttons are hard to tap, which is why testing on a real device matters.
What are breakpoints in responsive design?
Breakpoints are the screen or container widths at which the layout changes, for example from one column to two. They are set in CSS with media queries or container queries. Good breakpoints are chosen by looking at where the content stops fitting comfortably, not by copying the dimensions of popular devices.
Is responsive design good for SEO?
Yes, in the sense that it removes problems. Google indexes the mobile version of a page, and one responsive site with the same content on every device is the arrangement it recommends. Responsive design does not lift a site in the results by itself, but a site that works poorly on phones is likely to be held back.
Do I need a separate mobile website?
No. Separate mobile sites were a stopgap from the early days of smartphones. They mean maintaining everything twice, and they divide your search presence between two addresses. A single responsive website is simpler, cheaper to run and what search engines expect.