Responsive Design
Definition
A responsive page has three ingredients. A viewport meta tag tells the browser to lay out at the device's width rather than pretending to be a 980-pixel desktop. Layout is then expressed in flexible terms — percentages, flexbox, grid fractions, max-width instead of a fixed width. Media queries change the arrangement at chosen breakpoints, commonly near 640, 768, 1024 and 1280 pixels, though good breakpoints follow the content rather than a list of this year's phones. Images use srcset and sizes so a handset is not made to download a 2000-pixel file for a 390-pixel screen. The result is one HTML document at one address that holds up from a small phone to a widescreen monitor.
Why It Matters
Most visits now arrive from phones, and because Google indexes with a mobile crawler the small-screen rendering is the one that counts. A fixed-width layout on a handset produces the familiar failure: text at roughly a third of its intended size, sideways scrolling, and links packed too closely to tap accurately. Visitors leave in seconds and the bounce is measurable. The old alternative, a separate m-dot site, doubles the maintenance and creates duplicate content that then needs canonical tags to untangle. One document that adapts avoids the whole mess.
How It Works
The browser reads the viewport directive first and sets its layout width to the device width. CSS is then applied in order, with media query blocks such as a min-width of 768 pixels overriding the base rules once the condition holds. Writing the base rules for the narrow case and adding complexity upwards — mobile first — keeps the stylesheet smaller and avoids undoing desktop rules on the way down. Flexbox and grid reflow content without fixed pixel columns, and container queries, supported across all major browsers since early 2023, let a component respond to the space it has rather than to the window. All of this happens in the browser: the same bytes go to every device, and the layout decision is made on arrival.
Real-World Example
A designer exports a single-page site from a design tool and publishes it at ravel-studio.99helpers.site. On a laptop it looks right; on a phone a fixed 1200-pixel wrapper forces sideways scrolling and the type is unreadable. Adding the viewport tag and swapping the fixed width for a max-width plus one media query at 768 pixels fixes both. The corrected file is re-uploaded to the same address, so the link already sent to clients still works and version history keeps the old copy in case something else breaks.
Common Mistakes
- ✕Leaving out the viewport meta tag — the phone then lays the page out at 980 pixels and scales it down, so all the type comes out tiny
- ✕Picking breakpoints from a list of device widths — devices change every year, the point at which your own layout breaks does not
- ✕Sending one large image to every screen — a 2400-pixel hero costs a phone user real data for pixels the screen cannot even show
Related Terms
Viewport Meta Tag
The viewport meta tag is one line in the head of an HTML document that tells a mobile browser to lay the page out at the device's own width instead of pretending to be a desktop screen.
Mobile-First Indexing
Mobile-first indexing means Google crawls and indexes a site using a smartphone crawler, so the mobile version of a page is the version that gets stored and ranked.
Responsive Images
Responsive images means publishing the same picture at several sizes and letting the browser pick the one that fits. The srcset and sizes attributes are how you describe that choice in HTML.
Page Speed
Page speed is how quickly a page becomes useful to the person who opened it — not one number, but a set of measurements covering when content appears and when the page responds to input.
Static Site
A static site is a website made of finished files — HTML, CSS, JavaScript, images — that are sent to the browser exactly as they are stored. Nothing is assembled on the server when a visitor arrives.
Put a file online in seconds
Drop in a document, an image, a page or a whole static website and share the link — free, with no build step and no server to set up.
Host a file free →