Error Image with no src or srcset
Why an <img> with neither a src nor a srcset attribute renders as a broken image, and how it differs from a missing alt attribute.
The validator flags any <img> element that has neither a src attribute nor a srcset attribute.
Example
<!-- Wrong: nothing for the browser to load -->
<img alt="Team photo">
<!-- Right -->
<img src="/team.jpg" alt="Team photo">Why it matters
Without src or srcset, the browser has no image resource to request at all — the element renders as a broken-image icon (or nothing, depending on the browser and styling) regardless of how good its alt text is. This is different from a missing alt attribute, which is an accessibility gap on an image that otherwise loads fine. A missing src usually means a build step failed to inject a URL, a template variable resolved to undefined, or an <img> tag was copy-pasted without its source ever being filled in.
Frequently asked questions
Is srcset alone enough, without src?
Yes — a browser that supports srcset will pick an appropriate image from the list and doesn't need a separate src. It's still common practice to include a src as a fallback for very old browsers that don't understand srcset, but it isn't required for the image to load in a modern browser.
What does a browser show for an <img> with no src?
Typically a broken-image icon, sized according to whatever width/height or alt text is present, though the exact rendering varies by browser. Either way, nothing resembling the intended image appears.