What responsive design technically is
The term was coined by designer Ethan Marcotte in an article published on May 25, 2010, on A List Apart, where he laid out its three technical pillars: flexible grids, flexible images, and media queries. Each of those techniques existed on its own before that article. Marcotte was the one who combined them into a single design approach built for a web already viewed on many different devices.
Responsive design is a development technique: the same HTML document, with no duplicated code and no separate version per device, changes how it's presented depending on screen width through CSS rules. The browser loads the identical page whether it's opened on a phone or a desktop computer. What changes is how that content is arranged, not the content itself.
The central mechanism is media queries, CSS rules that apply a block of styles only when a condition is met, almost always the width of the viewport. The points where the layout switches from one arrangement to another are called breakpoints. Alongside media queries sit flexible grids (using flexbox or CSS grid, which distribute available space in proportions instead of fixed pixels) and fluid images, which scale without overflowing their container.
Setting breakpoints based on the content rather than specific devices usually works better than targeting particular phone or tablet widths: a device lineup that changes every year makes any breakpoint tied to a specific model outdated fast, while a breakpoint placed exactly where the layout itself starts to break down, a menu that crowds together or text that gets too narrow to read, keeps working no matter what devices are on the market.
A simple example: a full-width image on mobile and a horizontal menu from tablet width up, both defined in the same stylesheet.
<style>
.menu {
display: block; /* stacked by default, for mobile */
}
img {
max-width: 100%;
height: auto;
}
@media screen and (min-width: 768px) {
.menu {
display: flex; /* horizontal from tablet/desktop up */
}
}
</style>
For a mobile browser to actually honor this behavior, the document also needs the viewport meta tag in the head. It's a common thing to forget, and without it the phone renders the page at desktop scale and shrinks it down afterward, which cancels out the effect of the media queries.
<meta name="viewport" content="width=device-width, initial-scale=1" />
The tag itself didn't originate from a formal web standard. Apple introduced it in Safari on the original iPhone, so that sites built for desktop widths would still display in a usable way on a much smaller screen. Other mobile browsers later adopted the same syntax as a de facto standard, which is why it still works today even though it was never formally written into a W3C specification.
