Prompt

How do I deliver different image sizes based on device and screen width?

Technology / CDN & Edge Infrastructure2 observationsLast seen Nov 21, 2026

Latest observation

Nov 21, 2026OpenAI APIWeb search: off

Use responsive images so the browser picks the best file for the device and viewport width.

1) Use srcset + sizes for width-based switching

This is the most common approach when you have multiple image widths.

<img
  src="image-800.jpg"
  srcset="
    image-400.jpg 400w,
    image-800.jpg 800w,
    image-1200.jpg 1200w,
    image-1600.jpg 1600w
  "
  sizes="
    (max-width: 600px) 100vw,
    (max-width: 1200px) 50vw,
    800px
  "
  alt="Example image"
/>

How it works

  • srcset lists available image files and their widths.
  • sizes tells the browser how wide the image will be in the layout at different breakpoints.
  • The browser chooses the most appropriate file based on:
    • viewport width
    • device pixel ratio (e.g. Retina screens)
    • layout size

2) Use srcset with pixel-density descriptors for 1x/2x

If the image is displayed at a fixed size, use x descriptors:

<img
  src="image.jpg"
  srcset="image.jpg 1x, image@2x.jpg 2x"
  alt="Example image"
/>

This is good for icons or images with a known display size.

3) Use <picture> for art direction

If you want different crops or different images on mobile vs desktop, use <picture>:

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

Use this when the composition should change, not just the size.

4) Generate several image sizes

Usually you create multiple variants such as:

  • 400px
  • 800px
  • 1200px
  • 1600px

And optionally multiple formats:

  • AVIF
  • WebP
  • JPEG/PNG fallback

Example:

<picture>
  <source
    type="image/avif"
    srcset="image-400.avif 400w, image-800.avif 800w, image-1200.avif 1200w"
    sizes="(max-width: 600px) 100vw, 800px"
  >
  <source
    type="image/webp"
    srcset="image-400.webp 400w, image-800.webp 800w, image-1200.webp 1200w"
    sizes="(max-width: 600px) 100vw, 800px"
  >
  <img
    src="image-800.jpg"
    srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
    sizes="(max-width: 600px) 100vw, 800px"
    alt="Example image"
  >
</picture>

5) Best practices

  • Always include a normal src for fallback.
  • Match sizes to your real CSS layout.
  • Don’t send overly large images to mobile.
  • Compress and serve modern formats when possible.
  • Use loading="lazy" for below-the-fold images:
<img loading="lazy" ...>

Quick recommendation

  • Different sizes only: use srcset + sizes
  • Different crops/content: use <picture>
  • Retina support for fixed-size images: use 1x/2x descriptors

If you want, I can give you:

  1. a plain HTML example,
  2. a React/Next.js example, or
  3. a WordPress/CMS setup.

Brands

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations 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.