+ 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.

23rd Apr 2023, 9:51 AM
Yasin Rahnaward
Yasin Rahnaward - avatar
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.
23rd Apr 2023, 10:53 AM
Yasin Rahnaward
Yasin Rahnaward - avatar
+ 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.
23rd Apr 2023, 10:19 AM
Yasin Rahnaward
Yasin Rahnaward - avatar
+ 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
23rd Apr 2023, 10:38 AM
Yasin Rahnaward
Yasin Rahnaward - avatar
+ 1
There is no solution for css only loading background images, i searched it on google. You can use also js to do that

23rd Apr 2023, 10:35 AM
Ugulberto SĂĄnchez
Ugulberto SĂĄnchez - avatar
+ 1
So google was wrong??! Disgusting 😐
23rd Apr 2023, 10:39 AM
Ugulberto SĂĄnchez
Ugulberto SĂĄnchez - avatar
+ 1
Completely true. Sorry that I was wrong 😔
23rd Apr 2023, 10:55 AM
Ugulberto SĂĄnchez
Ugulberto SĂĄnchez - avatar
+ 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
23rd Apr 2023, 10:52 PM
Beldavisss đŸ‘Ÿ
Beldavisss đŸ‘Ÿ - avatar
27th Apr 2023, 7:12 PM
Cezary