by zzzcpan · 7y ago · 0 comments
<picture>
<source ...>
<img class="..."
src="data:... (placeholder, no image)"
data-sizes="..."
data-srcset="..."
data-lowsrc="..."
alt="..."
height="auto"
width="100%">
</picture>
Just don't use javascript for images and static content. It's better for SEO, for accessibility, it respects people's privacy, it works much faster.As for not following my own advice, that's not quite right. I'm using picture and img tags rather than div's with CSS background-image, which is the main thrust of the article.
I'm also using srcset for performance, and webp as a progressive enhancement for browsers that support it.
The only thing I'm not doing is using the new loading="lazy" because the website was creating long before the article.
But I would still want to use an actual picture element with srcset & source attributes/tags for the reasons mentioned in the article.