ScreenshotNeo

BlogGuides

Responsive Web Design Challenges and How to Solve Them

Fix mobile overflow, cramped layouts, oversized images, and reflow problems with flexible CSS, content-led breakpoints, and practical checks.

By the ScreenshotNeo team4 October 20269 min read

Responsive web design is a set of browser-native layout and media practices that helps a page work across screen sizes and resolutions while remaining usable. To fix a page that looks bad on mobile, start with a device-width viewport declaration, let content flow in flexible layouts, constrain media to its container, and add breakpoints where the content stops working. Then check the page at narrow, intermediate, and wide widths, including zoom and text enlargement.

Responsive design is not a separate technology. It combines flexible layout, media queries, a viewport declaration, and responsive media. The familiar historical formulation used fluid grids, fluid images, and media queries; modern CSS also offers Grid, Flexbox, and container queries. [MDN: Responsive web design]

1. Start with the right viewport and flexible layout

Put this viewport declaration in the document head. Without it, some mobile browsers lay out a page against a wider virtual viewport, so narrow-screen media queries may not behave as intended. Avoid disabling zoom with restrictive viewport settings: readers need to be able to enlarge content.

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

Build the narrow layout in normal document flow first. Use Grid or Flexbox for relationships between items, and allow columns only when there is room for their content. Avoid fixed page widths that force horizontal scrolling on phones or leave excessive blank space on wide screens.

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

img,
video,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

The min(100%, 16rem) prevents the minimum grid track from exceeding a very narrow container. For some layouts, an explicit breakpoint is clearer than automatic tracks. Choose it based on when the content becomes cramped, not on a named device width. Relative units such as em can make breakpoints respond more naturally to text sizing. [MDN: CSS media queries, MDN: Media query fundamentals]

2. Diagnose the failure before choosing a fix

What you see Likely cause First fix to try
Horizontal scrolling on a phone Fixed-width element, unbreakable content, or media wider than its container Find the overflowing element; use flexible sizing, allow long strings to wrap, and constrain media
Columns are too narrow to read Desktop columns are being squeezed instead of stacking Use a single column until there is enough available width for multiple columns
Large blank areas on a wide screen Fixed-width page or content area that cannot use available space Use a flexible max-width container and let layout tracks grow within readable limits
Images distort or download too much Forced dimensions or one oversized source used at every size Preserve intrinsic proportions and select an appropriate source with responsive image markup
Page looks unchanged on a phone Missing viewport declaration or rules that do not match the actual content width Add the viewport declaration, then inspect the page while resizing continuously
Content disappears or controls become unusable when enlarged Fixed heights, clipped overflow, or layout assumptions that fail under zoom Let content grow, avoid clipping, and check reflow and keyboard access

To locate overflow, temporarily apply an outline to elements or inspect widths in browser developer tools. Check the page’s own document width and the element extending beyond it; hiding overflow on the page may conceal the symptom without fixing the content.

3. Make breakpoints follow the content

A viewport media query asks how much room the page has. Use one when the overall composition should change, such as a navigation bar becoming a menu or a two-column page becoming one column. A container query asks how much room a particular component has. Use it when a reusable card or panel should adapt to its own allocated space, regardless of the full viewport. [MDN: Media query fundamentals]

/* Viewport-level layout change: choose the threshold where columns fit. */
.page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 48em) {
  .page {
    grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
  }
}

/* Component-level change: respond to the card's available width. */
.card-shell {
  container-type: inline-size;
}

.card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@container (min-width: 34em) {
  .card {
    grid-template-columns: 8rem 1fr;
    align-items: start;
  }
}

The values above are examples, not a universal breakpoint recipe. Resize the page continuously and note where a heading wraps awkwardly, controls collide, navigation becomes difficult, or columns become unreadable. Place the breakpoint near that failure. Firefox Responsive Design Mode can help explore widths. [MDN: Media query fundamentals]

4. Keep images and embedded media useful at every size

max-width: 100% is a useful baseline that prevents many images and media elements from overflowing. height: auto preserves an image’s proportions when its width changes. This is one documented fitting technique, not the only way to meet accessibility requirements. [W3C WAI: CSS C37]

Responsive sizing alone does not prevent a small screen from downloading a needlessly large image, and it cannot choose a different crop for a different composition. Use srcset and sizes for resolution switching. Use <picture> when art direction calls for a different crop.

<img
  src="/images/article-800.jpg"
  srcset="/images/article-480.jpg 480w,
          /images/article-800.jpg 800w,
          /images/article-1400.jpg 1400w"
  sizes="(min-width: 60rem) 50rem, 100vw"
  alt="A descriptive alternative for the image"
  width="1400"
  height="900"
>

<picture>
  <source
    media="(min-width: 50rem)"
    srcset="/images/chart-wide.jpg"
  >
  <img
    src="/images/chart-tall.jpg"
    alt="A descriptive alternative for the chart"
    width="700"
    height="900"
  >
</picture>

Use real intrinsic dimensions where possible, provide meaningful alternative text, and optimize source dimensions and format for their use. The browser uses sizes as a hint about the rendered slot width when selecting from a width-descriptor srcset; keep that hint aligned with the actual layout. [MDN: Responsive images and performance]

5. Check zoom, text enlargement, and reflow

Responsive behavior includes zoom states and viewport sizes, not just fitting a phone screen. W3C WAI advises: “Use responsive design to adapt the display to different zoom states and viewport sizes, such as on mobile devices and tablets.” [W3C WAI: Developing for Web Accessibility]

For ordinary article content, W3C describes fitting into a 320 CSS-pixel-wide viewport with only vertical scrolling as a common way to meet the Reflow criterion. This is an example tied to that criterion, not a complete test for every content type. Complex data tables and other content may need special treatment. [W3C WAI: Understanding Reflow]

  • Allow text containers and controls to grow; avoid fixed heights that clip enlarged content.
  • Do not disable user zoom.
  • Check text enlargement, high zoom, and a narrow viewport for lost content, overlap, and two-dimensional scrolling.
  • For wide tables or diagrams, provide a deliberate way to inspect the information without making ordinary reading content require horizontal scrolling.

6. A practical responsive-layout review

  1. Add the viewport declaration and confirm the page uses the device width.
  2. Start at a narrow width. Confirm the main content reads in normal flow and no element forces horizontal scrolling.
  3. Widen the viewport continuously. Note where the content has enough room for additional columns or a different navigation layout.
  4. Check intermediate widths, where a design can be more cramped than at either extreme.
  5. Review portrait and landscape orientations where they affect the task.
  6. Enlarge text and zoom in. Look for clipped controls, overlapping labels, hidden content, and fixed-height containers.
  7. Inspect image source selection and verify that embedded content fits its container.

This process follows the browser’s available space rather than testing only a short list of device presets. The cited guidance supports these techniques; it does not establish a universally best breakpoint or implementation for every site.

7. Troubleshooting common responsive-design problems

Horizontal scrolling remains after adding max-width: 100%

Another element may be responsible: a fixed-width wrapper, long URL, code sample, table, or positioned child. Inspect the element whose width exceeds its parent. Add wrapping where suitable, allow the relevant track to shrink with min-width: 0, or give genuinely two-dimensional content its own deliberate scrolling treatment.

The media query never seems to activate

Check that the viewport declaration is present, the query is in the loaded stylesheet, and the condition matches the current viewport. A mobile browser using a wider virtual layout viewport can make a narrow breakpoint appear ineffective.

The grid still overflows at the narrowest width

Grid items can have intrinsic minimum sizes. Use minmax(0, 1fr) for flexible tracks and min-width: 0 on children that must shrink. Check long unbroken strings and fixed-width descendants as well.

Images look stretched

Remove conflicting fixed width and height rules. Use height: auto when scaling proportionally, or use a deliberate cropped frame with object-fit: cover when cropping is intended.

The phone downloads images that are much larger than their display size

Provide appropriately sized candidates through srcset and an accurate sizes value. Use <picture> if a different crop is appropriate at a breakpoint.

Text or buttons overlap after zooming

Check fixed heights, absolute positioning, whitespace rules, and controls with rigid widths. Let content wrap and grow, and retest the actual interaction rather than only the initial appearance.

A layout works at the smallest and largest width but fails between them

Inspect intermediate widths during continuous resizing. Add or move a content-led breakpoint where the layout first becomes unusable, or use an intrinsic layout that can reflow without a breakpoint.

8. Performance, reliability, and implementation cost

Responsive layout does not automatically make a page fast. Flexible CSS can help one layout serve many widths, while responsive image candidates can avoid transferring an unnecessarily large source. Correct sizes, sensible image dimensions, and simple layout rules all matter. A source image that is too large still costs bandwidth even if CSS displays it small.

For reliability, prefer normal flow and intrinsic sizing where they meet the design. Each breakpoint is another condition to maintain, and complex fixed positioning or carefully tuned device-specific rules can fail at widths you did not anticipate. Test the widths between your chosen breakpoints, as well as zoom and text enlargement. There is no single breakpoint set that suits every page.

The CSS and HTML techniques in this guide are browser-native. Their implementation cost is mainly the work of changing layout constraints, choosing suitable image sources, and checking relevant states. No benchmark or hands-on site test is claimed here.

9. Or skip the browser setup

To inspect how a page renders across responsive states, browser tools let you choose a viewport and capture a screenshot. If you need a screenshot in code, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF. The browser-rendered page can be captured at a chosen viewport; the API also supports 12 device presets and arbitrary viewport dimensions. See the ScreenshotNeo API documentation.

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

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);

Replace YOUR_API_KEY with your key and the example URL with the page you want to capture. The Node.js example uses Bun’s file writer; with Node.js, save the response using your preferred file-writing method. ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. See ScreenshotNeo for product details and the docs for API options.

Sign up free for 1,000 screenshots a month, with no card required.

10. FAQ

Is responsive web design a framework?

No. It is an approach using browser features and practices such as flexible layout, media queries, viewport configuration, and responsive media.

Should every layout use container queries?

No. Use viewport queries for page-wide changes and container queries when a component’s layout depends on its containing block. Intrinsic Grid or Flexbox layouts may need neither.

Do I need a separate layout for every phone?

No. Let the content and available space determine the layout. Named devices are not a reliable substitute for finding where the content stops working.

Does max-width: 100% solve responsive images?

It helps prevent overflow, but it does not by itself choose a smaller download or a different crop. Use responsive image markup when source selection or art direction matters.

Sources