Unsure how your site should behave on a phone, tablet and desktop? Responsive web design lets one layout adapt to every screen, using flexible grids, fluid images and media queries.
This guide is part of our web design basics collection, so start there if you want the wider picture.
| Item | Value |
|---|---|
| Year Ethan Marcotte coined the term | 2010 |
| Default mobile page width without a viewport tag | usually about 980px |
| Recommended image rule | max-width of 100% |
| Minimum card size in web.dev’s grid demo | 200px |
| Example desktop layout | three or four columns |
These figures come from web.dev’s responsive basics guide and MDN’s responsive design article. Guidance and browser behavior can change, so check the sources before you rely on them.
What responsive web design actually is
Responsive web design is a strategy that changes a site’s layout to suit the device in use, based on what users need and what their devices can do. Ethan Marcotte originally defined it in A List Apart, as web.dev’s responsive basics guide explains.
A responsive site might show a single-column view on a phone, two columns on a tablet, and three or four columns on a desktop computer, according to web.dev. The goal is one site that works well for everyone, whatever they hold in their hands.
MDN stresses that it is an approach, not a separate technology. It aims to make pages render well on all screen sizes and resolutions while keeping usability good, as MDN’s article puts it.
The term was coined in 2010 and combined three ingredients, per MDN:
- Fluid grids that resize with the screen.
- Fluid images that never overflow their container.
- Media queries that adjust the layout at different widths.
Responsive layouts also sit on top of broader web design principles, so it helps to read that guide alongside this one.
Why fixed layouts stopped working
In the early 1990s most monitors were 640 pixels wide by 480 pixels tall, which made designing for a single width a safe bet, according to web.dev’s Learn Responsive Design course. Then phones arrived, and designers had to style content for screens as small as 240 pixels wide and as large as thousands of pixels wide.
Older answers to that problem each had a weakness:
- Fixed-width pages lead to scroll bars on narrow devices and too much empty space on wide screens, as MDN notes.
- Liquid layouts can look good across a wide range of widths, but they get worse at the extremes, says web.dev Learn.
- Separate mobile sites mean you have to maintain two separate codebases and designs, also per web.dev Learn.
Responsive design replaced all three with one flexible codebase. HTML already helps here: with no CSS at all, the browser reflows text to fit the viewport, as MDN describes.
Set the viewport first
Every responsive page needs the meta viewport tag in the head of the document. Without it, mobile browsers render the page at a desktop screen width, usually about 980px, and then scale fonts and content to fit, per web.dev.
The result is easy to spot: a page without the tag loads very zoomed out, which makes the text hard to read. You can confirm this in web.dev’s guide, which shows the page with and without the tag.
The standard value is width=device-width, which matches the screen’s width in device-independent pixels. Adding initial-scale=1 sets a one-to-one relationship between CSS pixels and device-independent pixels, so landscape orientation can use the full width, as web.dev explains.
Leave out minimum-scale, maximum-scale and user-scalable. web.dev advises against them because they can prevent the user from zooming the viewport, potentially causing accessibility issues.
Build fluid images and flexible layouts
Start with images, the most common cause of sideways scrolling. web.dev recommends giving all images a max-width of 100%, which shrinks them to fit the available space but stops them stretching beyond their initial size.
Also keep the width and height attributes on your img tags. They let the browser reserve space for images before they load, which helps prevent layout shifts, according to web.dev.
For the page layout, modern CSS does most of the work. Flexbox, grid and multicol make flexible grids much easier than the old percentage-based floats, per web.dev. Pick the tool that matches the job:
- Flexbox suits items of different sizes that should fit in a row, or wrap onto several rows as space shrinks.
- CSS grid uses the fr unit to share the available space in a container.
- Auto-fit grids place as many cards on each row as fit, and web.dev’s demo sets a minimum size of 200px for each card, as shown on its guide.

Media queries, breakpoints and fluid type
Media queries let you run tests, such as whether the screen is wider than a certain size, and apply CSS only when the test passes. That wording comes from MDN.
Choose each breakpoint by looking at your content, not at a list of devices. W3Schools says to apply breakpoints based on design needs, and it defines a breakpoint as the screen width where your layout needs to change.
Many teams write styles mobile-first: phone styles come first, and media queries then add rules for tablets and desktops, according to W3Schools. A simple workflow looks like this:
- Write a single-column layout that already works on a narrow screen.
- Widen the browser window slowly and note where the design starts to look stretched.
- Add a media query at that width and change only what needs to change.
- Repeat until the widest layout feels comfortable.
Two newer tools help on top of that. Container queries watch the size of a parent element instead of the whole screen, so a component adapts exactly where it sits, per W3Schools. The clamp() function sets a minimum, preferred and maximum value, which keeps text readable on every screen.
How do you check that a design really is responsive?
Forcing people to scroll sideways or zoom out causes a poor experience, as web.dev points out. Run through this short checklist before you publish:
- Confirm the viewport tag is present; a Lighthouse audit can automate that check.
- Look for content that overflows the viewport; web.dev names a Lighthouse audit that detects it.
- Make sure every image has dimensions and a fluid max-width.
- Resize the window and read the text at each width.
Once the layout holds, review your website color schemes so text stays easy to read at every size.
Frequently asked questions
Do I still need the viewport tag if I use CSS grid?
Show answer
Yes, add it anyway. The tag is what makes the browser match the device’s screen width, so your flexible layout gets a sensible width to work with. See web.dev’s basics guide for the exact markup.
Is responsive design the same as adaptive design?
Show answer
No. An adaptive site uses a single site with two or three fixed-width layouts and switches between them at set widths. A responsive layout flexes continuously, so it avoids awkward in-between sizes, as web.dev Learn describes.
Do I have to design mobile-first?
Show answer
It is a common habit rather than a rule. Starting with a narrow viewport and enhancing for larger screens keeps the base styles simple, and W3Schools recommends that route.
Can I use fixed pixel widths for some elements?
Show answer
You can, but content should not rely on one particular viewport width to look right. Pixel-based floats force sideways scrolling on small screens, a problem web.dev demonstrates with a side-by-side example.



