Every website now has to work on screens from a small phone held in one hand to an ultrawide monitor across a desk. Responsive design is the practice of building one site whose layout adapts to all of them, and breakpoints are the points where the layout changes — a menu collapses, a grid gains a column, a sidebar moves below the content.
A common question is “which breakpoints should we use?”, usually followed by a list of device widths. This guide explains why content, not devices, should decide, and covers the techniques that make modern responsive design simpler and more robust.
First: the viewport meta tag
Without one line in the page head, phones pretend to be desktops: they render the page at a wide virtual width and shrink it to fit, making text tiny.
<meta name="viewport" content="width=device-width, initial-scale=1">
This tells mobile browsers to use the device’s actual width in CSS pixels. Every responsive site needs it. Avoid adding maximum-scale=1 or user-scalable=no: they stop people zooming, which is an accessibility problem.
CSS pixels, device pixels and pixel ratio
Screens are measured in two kinds of pixels:
- Device pixels are the physical dots on the screen.
- CSS pixels are the units your stylesheet uses. On high-density screens, one CSS pixel is drawn with several device pixels.
The ratio between them is the device pixel ratio (DPR). A phone with a screen 1,080 device pixels wide and a DPR of 3 has a viewport 360 CSS pixels wide. Media queries use CSS pixels, so that phone matches max-width: 360px, not 1,080.
DPR matters for images: to look sharp, an image displayed 360 CSS pixels wide on that phone needs about 1,080 actual pixels. Our viewport checker shows the viewport, screen size and pixel ratio of whatever device you open it on.
Media queries, mobile-first
Media queries apply CSS only when conditions are met. The most common condition is the viewport width.
Mobile-first means writing your base styles for small screens, then adding styles for larger screens with min-width queries:
.cards { display: grid; gap: 16px; }
@media (min-width: 640px) {
.cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
.cards { grid-template-columns: repeat(3, 1fr); }
}
Why mobile-first?
- Small screens get the simplest CSS, without having to undo desktop styles.
- It forces you to prioritise: what really matters when space is tight?
- Layouts naturally add complexity as space allows, which is easier to reason about.
Modern CSS also supports range syntax, such as @media (width >= 640px), in current browsers. It is equivalent and easier to read, though min-width remains the most widely used form.
Why devices shouldn’t decide your breakpoints
Lists of “phone, tablet, desktop” widths go out of date as new devices appear, and they encourage designing three fixed layouts rather than one fluid one. Real visitors use an enormous range of sizes: phones of different widths, tablets in both orientations, laptops with browser windows at any size, split screens, and zoomed-in text (zooming to 200% halves the effective viewport width).
A better approach:
- Design and build the layout for a narrow screen.
- Slowly widen your browser window.
- When the layout starts to look wrong — lines of text too long, cards too stretched, too much empty space, a navigation bar that suddenly has room — add a breakpoint there.
- Repeat until the widest sensible size.
These content-driven breakpoints often end up near common device ranges anyway, but they are chosen because the design needs them.
Typical reference ranges
It still helps to know the territory, as long as you treat these as reference points rather than rules. Broadly:
| Range (CSS pixels) | Typical contexts |
|---|---|
| About 320–480 | Phones in portrait |
| About 480–768 | Large phones in landscape, small tablets |
| About 768–1024 | Tablets, small laptop windows |
| About 1024–1440 | Laptops and most desktop windows |
| 1440 and above | Large and ultrawide monitors |
Test the narrow end carefully: many phones have viewports around 360 to 430 pixels wide, and some layouts that look fine at 390 break at 320.
Fluid layouts reduce the need for breakpoints
The more flexible your layout, the fewer breakpoints you need.
Flexible grids
CSS grid can adapt column counts automatically:
.cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
gap: 16px;
}
This gives one column on small screens and as many 280-pixel-plus columns as fit on larger ones, with no media queries at all. The min(280px, 100%) part prevents overflow on very narrow screens.
Flexbox wrapping
flex-wrap: wrap lets items flow onto new lines when they run out of room — good for button groups, tags and toolbars.
Fluid typography with clamp()
Instead of switching font sizes at breakpoints, clamp() scales smoothly between a minimum and maximum:
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem); }
Use rem units as part of the calculation so text still responds to the user’s browser font-size setting.
Readable line lengths
Long lines are tiring to read. Limit text containers with something like max-width: 70ch so paragraphs stay comfortable on wide screens.
Container queries
Media queries respond to the viewport. But a card component might sit in a narrow sidebar on one page and a wide main column on another. Container queries let a component respond to the size of its own container instead:
.card-list { container-type: inline-size; }
@container (min-width: 500px) {
.card { display: grid; grid-template-columns: 160px 1fr; }
}
Container queries are supported in current major browsers. They make reusable components far easier to build, and fit naturally with design systems. Our UX and UI design glossary explains components and design systems.
Responsive images and media
Layouts adapt, so images must too.
- Use
max-width: 100%; height: auto;so images never overflow their containers. - Provide several sizes with
srcsetandsizesso phones don’t download desktop-sized images. - Use modern formats such as WebP or AVIF with fallbacks. Our image formats guide explains when to use each, and the image converter converts files in your browser.
- Reserve space with
widthandheightattributes or the CSSaspect-ratioproperty to prevent layout shift. The aspect ratio calculator gives you the CSS. - Consider art direction: a wide landscape hero may need a tighter crop on phones, using the
pictureelement with different sources.
Videos and embeds (maps, players) need the same care: wrap them in containers with an aspect ratio so they scale proportionally.
Touch and input
Responsive design is not only about width.
- Touch targets. WCAG 2.2 sets a minimum target size of 24 by 24 CSS pixels (with exceptions), and many platform guidelines recommend around 44 to 48 pixels for comfortable tapping.
- Hover. Don’t hide essential information behind hover effects; touch screens have no hover. Use
@media (hover: hover)for hover-only enhancements. - Pointer precision.
@media (pointer: coarse)detects touch-first devices if you need larger controls. - Orientation and safe areas. Phones with notches and rounded corners have safe-area insets;
viewport-fit=coverandenv(safe-area-inset-*)help keep content clear of them.
User preferences
Media queries can also respond to how people have configured their devices:
prefers-color-schemefor dark mode.prefers-reduced-motionto tone down animation.prefers-contrastfor people who need more contrast.
Respecting these is part of accessibility; see our accessibility basics guide. Visual effects should adapt too: shadows that look subtle in light mode can disappear in dark mode. Our box-shadow generator and CSS gradient generator let you preview effects against different backgrounds.
Performance is part of responsiveness
A layout that adapts but takes ten seconds to load on a mid-range phone isn’t responsive in any useful sense. Mobile visitors often have slower processors and connections than the laptop you design on.
- Ship less JavaScript; heavy scripts hurt interaction responsiveness (INP) most on phones.
- Optimise and lazy-load images.
- Test on real, mid-range devices, not only on a fast laptop with a narrowed window.
Our Core Web Vitals guide explains how speed is measured.
Testing responsive layouts
- Resize your browser slowly from very narrow to very wide and watch for breakage.
- Use device emulation in browser developer tools for quick checks, including touch emulation.
- Test on real devices: at least one small phone, one large phone and one tablet.
- Zoom to 200% on desktop to simulate a narrow viewport and check text reflows without horizontal scrolling.
- Check both orientations on phones and tablets.
- Rotate through dark mode and reduced motion settings.
If you are planning a redesign and want a layout system that scales cleanly across every screen, KRA Digital offers responsive web design and front-end development built on these principles.
Frequently asked questions
What are the standard breakpoints for responsive design?
There is no official standard. Many sites use reference points around 480, 768, 1024 and 1280 CSS pixels, but the best breakpoints are wherever your own content starts to look wrong as the screen widens or narrows.
Should I design mobile-first?
Mobile-first is a sound default: write base styles for small screens, then add min-width media queries for larger ones. It keeps CSS simpler and forces clear priorities.
Why does my phone report a smaller width than its screen resolution?
Phones use CSS pixels, which are larger than physical pixels on high-density screens. The device pixel ratio describes the difference; a phone with a 1,080-pixel-wide screen and a ratio of 3 has a 360-pixel-wide viewport.
What is the difference between media queries and container queries?
Media queries respond to the browser viewport or device features. Container queries respond to the size of a specific parent element, so a component can adapt to wherever it is placed.
How many breakpoints should a site have?
As few as the design needs. With flexible grids, fluid typography and container queries, many layouts need only two or three breakpoints, and some components need none.