I
I
iminby2021-06-16 22:01:30
css
iminby, 2021-06-16 22:01:30

Is there any way to set different formats for images in background?

Hello, tell me if, for example, for markup, you can go the way picture and soure set in several image formats, just in case, figuratively png and webp.
How to solve the issue with an image that is set in css, options, or take the risk that webp is suddenly not supported by a person, or implement all this through markup, stretching the image to the background through positioning?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Frolov, 2021-06-16
@Digiport

<picture>
                <source srcset="picture.webp">
                <source srcset="picture.png">
</picture>

For the second part of the question, read here:
https://habr.com/en/post/264491/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question