FlexGrid Academy Logo FlexGrid Academy Contact Us
Contact Us

Responsive Images: Making Them Actually Work

Images can break your responsive design if you’re not careful. Learn srcset, picture elements, and practical techniques to keep images sharp on every device.

11 min read Intermediate February 2026
Tablet and smartphone displaying same website content with proper image scaling and text readability across devices

Why Images Break Responsive Design

You’ve built a beautiful responsive layout. The text flows nicely from desktop to tablet to mobile. Then you add images and suddenly everything looks wrong. On a smartphone, your desktop-sized image forces horizontal scrolling. On tablets, images look blurry or pixelated. It’s frustrating because you’re doing everything right — except for the images.

The problem isn’t that images don’t work with responsive design. The problem is that most developers treat images like a single file that magically scales down. That’s not how modern web design works. You need to serve different images for different devices — and you need to do it efficiently.

Designer reviewing responsive image layout across multiple device screens in a modern workspace

Understanding the Srcset Attribute

The srcset attribute is where most developers start. It’s straightforward once you understand it. You’re basically telling the browser: “Here are three versions of this image. Pick the one that works best for your situation.” The browser then decides which version to load based on device width and pixel density.

Here’s a real example. You’ve got a product image. You create three versions: 600px wide for phones, 1000px for tablets, and 1400px for desktops. You tell the browser about all three using srcset. On a phone with 375px width? The browser loads the 600px version. On a desktop with 1920px width? It loads the 1400px version. The browser isn’t guessing — you’re giving it clear instructions.

One thing trips up beginners: the sizes attribute. You’ve got to tell the browser what size the image will actually be on the page. If your image takes up 100% of the viewport on mobile but only 50% on desktop, you need to say that. Without sizes, the browser can’t make the right decision about which image file to load.

Code editor showing HTML with srcset attribute and multiple image file sizes listed with width descriptors
Mobile phone and tablet side by side showing different cropped versions of same image optimized for each screen size

When to Use the Picture Element

Srcset handles most situations. But sometimes you need more control. That’s where the picture element comes in. You’ll use this when you want to serve completely different images based on screen size, not just different sizes of the same image.

Imagine a hero image. On desktop, it’s a wide landscape photograph. On mobile, that same wide image gets cropped so much that the main subject disappears. The solution? Serve a different image for mobile — maybe a portrait crop or even a completely different photo. The picture element lets you do exactly that.

You define multiple source elements inside picture, each with its own media query. The browser reads them top to bottom and uses the first one that matches. No media query? That’s your fallback. It’s simple but powerful. We’ve seen designers use this to serve landscape images on desktop and portrait images on phones, then adjust the layout to match. The result? Better composition and more professional-looking pages across all devices.

Image Optimization Techniques

Creating responsive images is half the battle. The other half? Making sure they actually load fast. A 2MB image file served to a phone on a 4G connection will destroy your performance.

Choose the Right Format

JPG works for photos with lots of colors. PNG for graphics and images that need transparency. WebP gives you better compression for modern browsers. Use the picture element to serve WebP to browsers that support it, with JPG as a fallback. You’ll save 25-35% on file size without losing quality.

Compress Aggressively

Don’t just export from Photoshop and call it done. Use a compression tool — TinyPNG, ImageOptim, or Squoosh. These tools remove unnecessary data without visible quality loss. A 1400px image should be under 200KB. If you’re above that, compress harder. Tools typically reduce file size by 40-60%.

Lazy Load Non-Critical Images

Images below the fold don’t need to load immediately. Add loading=”lazy” to your img tags and let the browser handle it. Only load images when users are about to see them. This is especially powerful on mobile where users are scrolling through content.

Set Explicit Dimensions

Always include width and height attributes on images. This tells the browser how much space to reserve before the image loads. Without this, the page layout shifts when images appear. It’s jarring for users and bad for performance metrics. Modern browsers use aspect-ratio to handle responsive sizing.

A Real-World Workflow

Let’s walk through how this actually works on a project. You’re building a portfolio site and need to display project images. Here’s what you do:

1

Create three sizes : Export your original image at 600px, 1000px, and 1400px widths. These cover phones, tablets, and desktops respectively.

2

Compress each file : Run them through Squoosh. You’ll get three optimized files, maybe 80KB, 140KB, and 200KB respectively.

3

Write the HTML : Add srcset with width descriptors and a sizes attribute telling the browser the image is 100% on mobile and 80% on desktop.

4

Test on devices : Check Chrome DevTools to see which image each device loads. Adjust srcset or sizes if needed. You’ll know it’s working when phones load the small file and desktops load the large one.

That’s it. You’re not reinventing anything complex here. You’re just being intentional about which image file each device gets. The result? Your site loads faster, images look sharper, and users on slow connections don’t wait forever for huge files.

Web developer working at desk with multiple monitor screens showing image optimization process and file size comparisons

Making Responsive Images Part of Your Process

Responsive images aren’t complicated. They just require a different mindset. Instead of uploading one image and hoping it works everywhere, you’re creating a system. You’re thinking about what each device needs. You’re measuring file sizes and compression ratios. You’re being intentional.

Start small. Pick one section of your site and implement srcset properly. Measure the performance improvement. See how much faster pages load. Once you feel the difference, you’ll want to do it everywhere. That’s when responsive images become second nature — not a task you’re checking off, but a fundamental part of how you build.

Key Takeaway: Responsive images are about serving the right file size to the right device. Srcset for size variations, picture for completely different images, optimization for performance. Three tools. One goal. Much faster websites.

Educational Disclaimer

This article provides educational information about responsive image techniques and best practices. The methods described are general guidelines based on current web standards and common implementations. Your specific project requirements, browser support needs, and performance goals may differ. Always test thoroughly with your actual content and target devices. Browser capabilities, image formats, and web technologies evolve constantly — consider checking official documentation for the latest specifications and recommendations.