Product page images lack "src" tag - causes W3C validation error

It seems like the standard media.liquid images lack a “src” tag, causing a W3C validation error.

A “dumb” work-around is to add this in the liquid file and use some 1 kb image as a “placeholder” and add a src reference to such an image. This fixes the validation error, but seems really hacky.

Is there a “proper” way to solve this issue and attain proper validation on e.g. product pages?

You can add an image inline using base64


Hi again,

My concern with either solution is whether the use of a “dummy image” as the src input will cause Google to incorrectly interpret this dummy image as the ‘main image’ of the product page, instead of the actual product image?

Google Search crawlers (I am not sure about other search engine) are able to render the page when lazy-loading is implemented correctly