Limited support Use with care and provide a fallback when broad support matters.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
126
126
126
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

HTML
<img src="photo.jpg"
  srcset="photo-400.jpg 400w, photo-800.jpg 800w"
  sizes="auto"
  loading="lazy"
  alt="自動サイズ計算の画像">

Live demo

Lazy image with sizes auto

Combine loading="lazy" with sizes="auto" for layout-based source selection.

PreviewFullscreen

Auto sizing note

The auto keyword for sizes derives the layout width from the image slot, but it applies only when loading is lazy.

PreviewFullscreen

Responsive image checklist

Combine auto sizing with dimensions and meaningful alt text.

PreviewFullscreen

Use cases

  • Use <img sizes="auto" loading="lazy">

    Use <img sizes="auto" loading="lazy"> when standard HTML needs a more specific platform feature, semantic signal, or browser capability.

  • Handle edge cases

    Apply <img sizes="auto" loading="lazy"> to solve a focused requirement without redesigning the whole page architecture.

Cautions

  • Test <img sizes="auto" loading="lazy"> in your target browsers and input environments before depending on it as a primary behavior.
  • Provide a fallback path or acceptable degradation strategy when support is still limited.

Accessibility

  • Make sure <img sizes="auto" loading="lazy"> supports the intended task without making the page harder to perceive, understand, or operate.