+ 5
How we could load lazy Background image?
There is a css property which all new version of browser supports for img lazy loading that is loading with lazy value on image tags. But is there any css solution for background-iamg lazy loading? đđ§ I know that there is some packages for that and interestion observer API is another solution but it's hard to Implement.
11 Answers
+ 5
So google was wrong??! Disgusting đ
could be, day by day technologies gets updates and a simple & fast to code solution is better then copy- past & older solution.
+ 2
Ugulberto SĂĄnchez
I know the intersection API can handle it, but my question is specifically about a css solution for background-image lazy loading, which we have a css solution for lazy load on <img/> tag that all new version browsers support it.
+ 2
Thanks but I am comfortable with css so if there is no solution for it, I will replace all background-image with img tags
+ 1
There is no solution for css only loading background images, i searched it on google. You can use also js to do thatâŠ
+ 1
So google was wrong??! Disgusting đ
+ 1
Completely true.
Sorry that I was wrong đ
+ 1
Use the WebP format: The WebP image format may be faster to load than other formats, such as JPEG or PNG. You can use online tools to convert your images to the WebP format or load the image on a CDN
0
You may want to read article I wrote:
https://www.sitelint.com/blog/lazy-loading-css-background-images-for-better-website-loading-performance/
HTH