Skip to content
IT glossary
FrontendUpdated December 3, 2026

Responsive design

Адаптивная вёрстка

A way to build web pages that adjust to the space available, keeping text readable and controls usable on both narrow and wide screens.

Also known as: адаптив

What responsive design means

A responsive page rearranges itself instead of shrinking a desktop layout to fit a phone. A news site might show a story and a related-articles sidebar next to each other in a wide window, then move the sidebar below the story in a narrow one. The narrow window could be on a phone, but it could just as easily be a desktop browser snapped to one side of the screen.

Start with a flexible layout

Flexbox can wrap a row of items onto another line, and CSS Grid can divide the available space into columns. Images can shrink to fit their containers with max-width: 100% and height: auto. These rules let the layout adjust continuously, not just at the exact widths shown in a design mockup.

When the layout needs to change more substantially, use a media query. For example, @media (min-width: 48rem) applies its rules when the viewport—the browser area available to the page—is at least that wide. That threshold is a breakpoint. Pick it where the content has room for the new layout, not because it happens to match a particular tablet. If the decision should depend on the space assigned to a component rather than the viewport, use a container query. A product card can then stack its image above its text in a sidebar and place them side by side in the main column of the same page.

Example: a grid without device breakpoints

.products {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

Grid adds columns when there's enough space for another 16rem track and the gap. Below 16rem, the minimum track size drops to the available width, so the track itself doesn't force horizontal scrolling. No media query is needed for this change. On mobile pages, include <meta name="viewport" content="width=device-width, initial-scale=1"> so the browser lays out the page at the device's width in CSS pixels instead of using a wider default layout viewport.

What to test

Resize the window through a range of widths, not just the presets in DevTools. Try longer labels, browser zoom, and keyboard navigation. Moving items visually with CSS doesn't normally change their keyboard focus order, so check that tabbing still follows a sensible path. Also distinguish layout from image loading: CSS can make an image look smaller, but it doesn't make the downloaded file smaller. Supply multiple image widths with srcset and describe the expected display width with sizes so the browser can choose a suitable file.

In an interview

You might be given a wide and a narrow mockup and asked to implement both. Explain what can flex or wrap on its own, what needs a breakpoint, and how you'd check the widths that aren't in either mockup.