Wondering why your site looks fine on a laptop but cramped on a phone? Responsive web design fixes that: the layout adapts to any screen size using flexible grids, flexible images and media queries.
This guide is part of our web design basics series, so you can pick up the neighbouring topics next.
| Item | Value |
|---|---|
| Year Ethan Marcotte coined “responsive design” | 2010 |
| Width many mobile browsers fall back to without a viewport tag | about 980px |
| Recommended maximum width for images | 100% |
| Minimum card size in web.dev’s flexible grid demo | 200px |
| Recommended viewport tag value | width=device-width, initial-scale=1 |
| Example column pattern | One column on a phone, two on a tablet, three or four on a desktop |
These figures come from web.dev’s responsive web design basics and MDN’s responsive web design guide. Browser behaviour and recommendations can change, so check the sources before you rely on them.
What responsive web design actually is
It is an approach rather than a tool. MDN describes it as a set of best practices for building a layout that can respond to any device showing it, and says it is not a separate technology. The term was coined by Ethan Marcotte in 2010, as MDN’s guide explains, and it combined three ingredients:
- Fluid grids that stretch and shrink with the screen.
- Fluid images that never spill outside their container.
- Media queries that apply different CSS depending on the browser’s conditions.
web.dev gives a simple picture of the result: a responsive site might show a single column on a phone, two columns on a tablet, and three or four columns on a desktop computer. Its basics article adds that modern responsive design also accounts for touch screens, with the goal of a good experience for everyone.
The alternative does not work well. Setting a fixed page width leads to scroll bars on narrow devices and too much empty space on wide screens, according to MDN.
Setting the viewport before anything else
Start with the viewport meta tag, because nothing else behaves properly without it. If it is missing, mobile browsers render the page at a desktop width of usually about 980px, then enlarge fonts and scale the content to fit, as web.dev describes. The result is inconsistent text and a lot of pinching and zooming.
The fix is one line in the head of your document: <meta name=”viewport” content=”width=device-width, initial-scale=1″>. The first value tells the page to match the screen’s width in device-independent pixels, so content can reflow for each screen. The second value, initial-scale=1, keeps CSS pixels and device-independent pixels in step even when the phone rotates, so the page can use the full landscape width, per web.dev.
You will see other attributes such as minimum-scale, maximum-scale and user-scalable. web.dev advises against them because they can stop people zooming, which creates accessibility problems.
How do flexible images and layouts work?
Images are the most common cause of broken mobile layouts, since a wide image can force sideways scrolling. web.dev recommends giving every image a max-width of 100%, so it shrinks to fit the available space but never stretches beyond its original size. It also suggests keeping width and height attributes on each img tag so the browser can reserve space before the file loads, which helps prevent layout shifts, as its basics article explains.
For page structure, percentages were the old answer. Modern CSS gives you better options, and web.dev notes that flexbox, grid layout and multicol make flexible grids much easier to build:
- Flexbox suits a set of items of different sizes that should fit comfortably in a row, or wrap onto more rows as space shrinks.
- CSS Grid builds flexible grids, including layouts with as many cards per row as fit, such as the demo on web.dev with a minimum card size of 200px.
- Multicol flows text into columns that adjust to the space available.

Media queries and breakpoints
Flexible layouts handle most of the work, but sometimes a design needs a bigger change. Media queries run tests, such as whether the screen is wider than a certain size or resolution, and apply CSS only when the test passes, according to MDN.
The width at which your layout changes is called a breakpoint. MDN lists mobile-first thinking and breakpoints among the core ideas behind media queries, and a sensible habit is to let your content, not specific devices, tell you where a layout starts to look strained.
Text deserves the same attention as boxes and columns. For type that stays readable on small screens, read our guide to the best fonts for websites.
A quick checklist for your own pages
If you sketch layouts before building them, our explainer on wireframe vs mockup vs prototype shows which stage answers which question. Once you have a page to test, work through these steps:
- Confirm the viewport meta tag is present in the head of every template.
- Give images a max-width of 100% and keep their width and height attributes.
- Resize the browser window slowly and watch for horizontal scrolling.
- Run the Lighthouse audit for content that is not sized correctly for the viewport, which web.dev says can automate detecting overflow.
- Try the page on a real phone, using touch rather than a mouse.
Frequently asked questions
Is responsive design the same as a mobile site?
Show answer
Not quite. Older mobile-friendly approaches often detected the visiting device on the server and handed it a simpler page. A responsive page sends the same content to everyone and lets the layout adapt, as MDN outlines.
Do I need CSS to make a page responsive?
Show answer
Plain HTML already reflows text when you resize the window, so a page with no styling is fluid by default. CSS is what makes it look good, since very long lines on a wide monitor are hard to read, and narrow columns can look squashed on a phone.
Why does my page look tiny on a phone?
Show answer
The usual culprit is a missing viewport tag. Pages without it load very zoomed out, which makes text hard to read until the tag is added, according to web.dev.
Do phones still need special treatment?
Show answer
Yes. Phones can run the same technologies as desktops, but battery life and bandwidth remain real constraints, as MDN points out. Showing mobile visitors only what they need is still good practice.



