DEV Community

Discussion on: Optimizing images for the web - an in-depth guide

Collapse
 
malvoz profile image
Robert Linder

Although this post mentions native lazy-loading, seeing as it is already available in Chrome for desktop and Android (that's over 50% browser support! caniuse.com/#feat=loading-lazy-attr) - I think it'd be wise to conditionally load JS library for lazy-loading only when native isn't available, more info on that here: web.dev/native-lazy-loading

Collapse
 
malvoz profile image
Robert Linder • Edited

Also, to improve performance and avoid content shifts - remember to set the width and height attributes for <img>, more info in this video from Jen Simmons of the CSS Working Group: youtube.com/watch?v=4-d_SoCHeWE

Collapse
 
adrianbdesigns profile image
Adrian Bece

Thank you very much for the info on implementing the native lazy loading with fallback.