Use WebP images inside background

I try to use WebP inside background. How to manage old browsers as it demands

  <source type="image/webp" srcset="background.webp">
  <source type="image/jpeg" srcset="background.jpg">
  <img src="background.jpg" alt="">

Code for the background is the following:


Have a look at this CSS Tricks article that mentions methods of handling background images using modernizr.

However i don’t believe you will be able to inline them because they will need to be linked to the modernizr class.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.