Prompt

How do I fix broken responsive image srcset output?

Technology / CDN & Edge Infrastructure1 observationLast seen Nov 3, 2026

Latest observation

Nov 3, 2026OpenAI APIWeb search: off

To fix broken responsive image srcset output, the key is to ensure the generated HTML is valid and the image URLs, widths, and sizes attribute all match what the browser expects.

Common problems and fixes

1) Wrong srcset syntax

Each candidate in srcset must be:

image-320.jpg 320w, image-640.jpg 640w, image-1280.jpg 1280w

or for pixel-density descriptors:

image.jpg 1x, image@2x.jpg 2x

Common mistakes:

  • Missing commas
  • Missing width descriptor (320w)
  • Using px instead of w
  • Extra spaces or malformed URLs

2) Missing or incorrect sizes

If you use w descriptors, you usually need sizes. Without it, browsers may choose the wrong file.

Example:

<img
  src="image-640.jpg"
  srcset="image-320.jpg 320w, image-640.jpg 640w, image-1280.jpg 1280w"
  sizes="(max-width: 600px) 100vw, 600px"
  alt="Example"
/>

What this means:

  • On screens up to 600px wide, image takes full viewport width.
  • Otherwise it renders at 600px.

If sizes doesn’t match your CSS layout, responsive selection breaks.


3) src doesn’t match a valid fallback

Always include a valid src as a fallback:

<img src="image-640.jpg" ...>

If src is broken, some browsers or edge cases may show no image.


4) Generated URLs are incorrect

If your CMS/build tool generates bad URLs, check:

  • base path
  • CDN prefixes
  • query strings
  • escaping/encoding
  • file existence

Example of a broken output:

srcset="https://cdn.example.com/image.jpg?width=320w"

That is wrong because 320w must be a descriptor, not a query parameter.

Correct:

srcset="https://cdn.example.com/image-320.jpg 320w"

5) Mismatched image dimensions

If the image files don’t actually match the widths in srcset, the browser can still load them, but the output may look blurry or oversized.

Make sure:

  • image-320.jpg is actually ~320px wide
  • image-640.jpg is ~640px wide
  • etc.

6) CSS is overriding the responsive behavior

The browser uses the rendered size of the image to determine which candidate to pick.

Make sure your CSS is sensible:

img {
  max-width: 100%;
  height: auto;
}

Avoid fixed widths that contradict your sizes attribute.


7) Art direction needs <picture>, not just srcset

If you need different crops for different layouts, use <picture>:

<picture>
  <source media="(max-width: 600px)" srcset="image-mobile.jpg">
  <source media="(min-width: 601px)" srcset="image-desktop.jpg">
  <img src="image-desktop.jpg" alt="Example">
</picture>

Use srcset on <img> for size-based selection, and <picture> for crop/format changes.


A known-good example

<img
  src="photo-800.jpg"
  srcset="photo-400.jpg 400w, photo-800.jpg 800w, photo-1200.jpg 1200w"
  sizes="(max-width: 768px) 100vw, 768px"
  alt="Landscape photo"
  style="max-width: 100%; height: auto;"
/>

Quick debugging checklist

  • Is srcset valid and comma-separated?
  • Are descriptors 320w, 640w, etc. correct?
  • Is sizes present when using w descriptors?
  • Do the files actually exist?
  • Do CSS widths match the intended display size?
  • Is src a usable fallback?
  • Do you need <picture> instead?

If you want, paste your current img tag or generated HTML and I can pinpoint exactly what’s broken.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.