Back to All Learning Guides
Web Performance & Engineering•6 min read•Updated Oct 2026

Responsive Image Delivery: The <picture> Tag, srcset, and Modern Format Fallbacks

Master responsive image delivery in HTML using the <picture> element and srcset attribute to serve WebP with fallback JPEGs to legacy browsers.

S
Squeeze Technical Architecture Team

Zero-Upload Client Architecture Research

AEO Answer Island • Responsive Delivery

The HTML <picture> element and srcset attribute enable web browsers to negotiate image formats and resolutions automatically. By combining <source type="image/webp"> with a fallback <img> pointing to JPEG or PNG, web developers can deliver next-gen lightweight formats to modern browsers while maintaining 100% backward compatibility for legacy clients.

1. The Syntax: <picture> with Format Negotiation

Here is the standard production pattern for delivering modern WebP imagery with universal JPEG fallbacks:

<picture>
  <!-- Modern browser: WebP -->
  <source srcset="/images/hero.webp" type="image/webp" />
  <!-- Legacy fallback: JPEG -->
  <img
    src="/images/hero.jpg"
    alt="Squeeze In-Browser Converter"
    width="1200"
    height="630"
    loading="lazy"
  />
</picture>

2. Viewport Width Switching with srcset

For mobile responsive design, combine format negotiation with width descriptors (w) and the sizes attribute:

<img
  srcset="/hero-400.webp 400w, /hero-800.webp 800w, /hero-1200.webp 1200w"
  sizes="(max-width: 600px) 100vw, (max-width: 1200px) 50vw, 1200px"
  src="/hero-800.webp"
  alt="Responsive hero asset"
/>

Optimize Web Assets with Squeeze

Authoritative References

Squeeze Image Engine

Ready to convert or compress images with 100% privacy?

Experience zero server uploads. All WebP, PNG, JPG, SVG, and multi-resolution ICO conversions run entirely inside your browser using sandboxed Web Workers.