Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
CSS

How to Build a Responsive Website: A Practical, Accessible Workflow

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build responsively from the content out: start with a readable narrow-screen layout, add flexible Grid or Flexbox rules, place breakpoints where the content needs them, and test zoom, keyboard use, images, and intermediate widths. Responsive design is not a set of device-specific pages; it is one layout that adapts to available space and user settings.

What responsive web design means

A responsive website adapts its layout, content and media to the conditions in which it is viewed. The same document should remain usable on a phone, tablet, desktop monitor, browser zoom level and enlarged text setting.

HTML in normal flow already provides a useful foundation: paragraphs wrap, blocks stack and content follows source order. Problems usually appear when CSS imposes fixed widths, rigid columns or media that cannot shrink. The symptoms are horizontal scrolling, tiny text, clipped controls and large unused areas.

Modern CSS gives you flexible primitives rather than a collection of phone, tablet and desktop mock-ups. Flexbox handles one-dimensional rows or columns; Grid handles two-dimensional arrangements; media queries apply a change only when a measured condition makes it necessary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

1. Start with content and source order

Write the document in the order a reader should encounter it: heading, introduction, primary content, supporting content and actions. Use semantic elements such as header, nav, main, section, article and footer.

Begin with a narrow layout in normal flow. This mobile-first baseline is not a special mobile version; it is the least constrained version of the content. It also gives keyboard users a sensible focus sequence. If a wide-screen design visually moves an item with Grid or Flexbox, keep the HTML order logical and verify the resulting tab order.

<body>
  <header class="site-header">
    <a href="/" class="brand">Example Studio</a>
    <nav aria-label="Primary">
      <a href="/work">Work</a>
      <a href="/about">About</a>
      <a href="/contact">Contact</a>
    </nav>
  </header>
  <main>
    <section class="hero">
      <h1>Design that works everywhere</h1>
      <p>A short explanation that remains readable when text is enlarged.</p>
      <a class="button" href="/contact">Start a project</a>
    </section>
    <section class="cards" aria-labelledby="services-title">
      <h2 id="services-title">Services</h2>
      <article class="card"><h3>Research</h3><p>Understand the problem.</p></article>
      <article class="card"><h3>Design</h3><p>Shape a usable solution.</p></article>
    </section>
  </main>
</body>

2. Configure the viewport

Put this element in the document head:

<meta name="viewport" content="width=device-width">

Without it, a narrow device can expose a wider virtual viewport and prevent small-screen media queries from behaving as intended. initial-scale=1 is common but usually unnecessary; consider adding it when overflow causes unwanted initial shrinking:

<meta name="viewport" content="width=device-width, initial-scale=1">

Never disable pinch zoom with user-scalable=no or a restrictive maximum scale. People need zoom and text enlargement, and your layout must survive both.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Build a flexible base layout

Use relative units and constraints instead of a fixed page width. The following CSS creates a narrow baseline, prevents accidental overflow and limits line length for comfortable reading.

:root {
  font-family: system-ui, sans-serif;
  color: #17202a;
  background: #fff;
  line-height: 1.5;
}

* { box-sizing: border-box; }

body { margin: 0; }

.site-header,
main {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

nav { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero { padding-block: 3rem; max-inline-size: 45rem; }

.cards {
  display: grid;
  gap: 1rem;
}

.card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #d7dce2;
  border-radius: .5rem;
}

img, video, svg { max-inline-size: 100%; height: auto; }

.button {
  display: inline-block;
  padding: .7rem 1rem;
  border-radius: .4rem;
  background: #1456d9;
  color: white;
  text-decoration: none;
}

min-width: 0 is important for Grid and Flexbox children containing long words or code. The image rule keeps media inside its container. A maximum readable line length prevents a large monitor from producing exhausting paragraphs.

4. Add breakpoints where content needs them

Resize the page and note the point at which navigation wraps awkwardly, cards become too narrow or a control loses usable space. Put a breakpoint there, not at a named phone or tablet width. Relative units such as rem are preferable because they respond to text sizing.

@media (min-width: 48rem) {
  .hero { padding-block: 6rem; }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 70rem) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto;
    animation-duration: .01ms;
    transition-duration: .01ms;
  }
}

Media queries can inspect width, height, orientation, resolution, pointer and hover capability, and user preferences. Width alone does not identify a device: a wide window may have touch input, and a narrow window may use a mouse. If the flexible base already works, you may not need a breakpoint at all.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Make images and other media responsive

Scaling one enormous source image down can waste transfer bandwidth. Use srcset and sizes when the browser can choose among resolutions, and use picture when the crop or format should change.

<img
  src="hero-800.jpg"
  srcset="hero-400.jpg 400w, hero-800.jpg 800w, hero-1600.jpg 1600w"
  sizes="(min-width: 48rem) 50vw, 100vw"
  width="1600"
  height="1000"
  alt="People collaborating around a table">

The sizes value describes the rendered width, allowing a suitable candidate from srcset to be selected. If a small screen needs a different composition, provide art direction:

<picture>
  <source media="(max-width: 47.99rem)" srcset="portrait-crop.jpg">
  <img src="wide-crop.jpg" alt="Product dashboard on a laptop">
</picture>

Give images dimensions to reduce layout movement, preserve meaningful alternative text, and check that focal points remain visible at every width. Apply the same containment principle to video, SVG and embedded content; an unbounded iframe can reintroduce horizontal scrolling.

6. Treat text, zoom and controls as first-class layouts

Use relative sizing where text should respond to user preferences. Avoid putting essential information in a fixed-height box; enlarged text must be able to wrap and increase the component’s height. Buttons and links need enough space to remain distinguishable when zoomed.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Test at normal browser zoom and at enlarged zoom or text settings. Look for clipped headings, overlapping controls, menus that cannot be reached and dialogs that extend beyond the viewport. Do not solve these problems by hiding text or preventing zoom.

7. Test at changing widths and input modes

Responsive work is an iterative inspection process. Drag the browser edge slowly rather than checking only a few device presets. Record the first width where a problem appears, adjust the layout or add a content-led breakpoint, then repeat.

  • Width: Check narrow, intermediate and very wide windows for overflow, awkward wrapping and unreadable line lengths.
  • Orientation: Rotate or emulate portrait and landscape; ensure media and navigation still fit.
  • Zoom and text: Enlarge content and verify that every action and message remains available.
  • Keyboard: Tab through the page, inspect visible focus, and confirm source order matches the visual story.
  • Pointer and touch: Check hover-dependent features with a pointer and the same controls without hover.
  • Preferences: Respect reduced-motion behavior where animations or transitions are present.
  • Content extremes: Try long headings, long unbroken URLs, translated text and empty or missing images.

Choosing between layout techniques

Choice Use it when Check
Normal flow Content can stack naturally. Reading order and spacing remain clear.
Flexbox Items share one row or column and may wrap. Children can shrink; wrapping does not hide controls.
Grid You need rows and columns or card tracks. Use flexible tracks such as minmax(0, 1fr); source order remains logical.
Media query A real width, preference or input condition requires a change. The change fixes a measured content problem rather than a device label.
srcset/sizes The same image has multiple useful resolutions. The selected file matches rendered size and network needs.
picture The crop or source format must change. The subject remains visible at each art direction.

Common failures and fixes

Horizontal scrolling on phones

Cause: a fixed-width container, oversized image, long unbroken string or flex item refusing to shrink. Fix: remove the fixed width, use a constrained fluid wrapper, apply max-inline-size:100% to media, add min-width:0 to flex/grid children, and decide how long strings should wrap or scroll.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

The mobile breakpoint never activates

Cause: the viewport is using a wide virtual width. Fix: add <meta name="viewport" content="width=device-width"> in <head>, then inspect the actual viewport width.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cards are cramped at an intermediate width

Cause: a breakpoint was chosen for a device category rather than the content. Fix: keep one column until the cards have enough room, or use flexible tracks and measure the point at which labels and controls fit.

Zoom breaks the interface

Cause: fixed heights, absolute positioning or a rule that disables zoom. Fix: allow content-driven height, let text wrap, remove zoom restrictions and test enlarged text again.

Visual order differs from keyboard order

Cause: aggressive order or Grid placement. Fix: restore a logical source order and use visual rearrangement only when the reading and focus sequence still make sense.

An image looks sharp but loads slowly

Cause: every viewport receives the largest source. Fix: provide width candidates with srcset and describe the rendered slot with sizes; use a different crop with picture when necessary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and maintenance

Keep the baseline simple so it works before enhanced CSS is applied. Prefer a few understandable breakpoints over many overlapping overrides. Re-test when content, fonts, navigation or image crops change: responsive failures often come from new content rather than from the original layout rules.

When a component fails, classify the failure before editing CSS: overflow, insufficient space, source-order problem, media selection, preference handling or input-mode assumption. That diagnosis usually points to a smaller and more durable fix than adding another arbitrary breakpoint.

Or skip the browser setup

If you need screenshots for documentation, visual checks or an automated workflow, ScreenshotNeo can capture a URL with one request. It accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and every response identifies the result with X-Page-Verdict and X-Billed headers.

It also provides an MCP server for Claude, Cursor and other MCP clients, with take_screenshot, get_page_info and capture_pdf tools. You can request full-page captures with lazy images loaded, CSS-selector elements, dark mode, device presets or custom viewports, retina scale, PDFs, custom CSS and JavaScript, clicks, waits, blocked resources, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data and an OpenAPI specification. Parameter names used by other screenshot APIs also work for easier migration.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the API key and target URL shown below; the complete parameter reference is in the ScreenshotNeo documentation.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan, and yearly billing provides two months free. Create a free ScreenshotNeo account to start.

Frequently Asked Questions

Do I need a separate mobile website?

Usually no. One semantic document with fluid layout, responsive media and content-led breakpoints can adapt across widths. A separate experience is justified only when the content or task genuinely differs.

How many breakpoints should a site have?

There is no correct count. Add one only when the current layout stops fitting or a user preference requires a change; a flexible base may need none.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I test only popular phone sizes?

No. Test continuously across intermediate widths, zoom levels, orientation and input methods. Problems often occur between named device presets.

Quick Recap

SaleBestseller No. 1
HTML and CSS: Design and Build Websites
HTML and CSS: Design and Build Websites
HTML CSS Design and Build Web Sites; Comes with secure packaging; It can be a gift option
$14.18
SaleBestseller No. 3
SaleBestseller No. 4
Web Design with HTML, CSS, JavaScript and jQuery Set
Web Design with HTML, CSS, JavaScript and jQuery Set
Brand: Wiley; Set of 2 Volumes
$35.05

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.