I have started using webp images in my site with <picture>
tag. all set except this
<section class="sec-bg" style="background: url('images/bg.jpg');">
I don't know, how to set the different background image format (png and webp) of the same image. please give a solution for this inline CSS in the section tag.
for other images, I'm using below code
<picture>
<source srcset="img/awesomeWebPImage.webp" type="image/webp">
<source srcset="img/creakyOldJPEG.jpg" type="image/jpeg">
<img src="img/creakyOldJPEG.jpg" alt="Alt Text!">
</picture>
webp
orno-webp
added automatically tohtml
element. Then you can style your elements like.webp <my-element-selector> { ... url for webp }
and.no-webp <my-element-selector> { ... url for png/jpg }
. – Rumal