logoalt Hacker News

0pointsyesterday at 10:30 AM1 replyview on HN

> 5% of people can't view them, yet 25% of top websites use them?

That's not how it works.

The server declares what versions of media it has, and the client requests a supported media format. The same trick have been used for audio and video for ages too.

Example:

    <picture>
        <source srcset="a.webp" type="image/webp">
        <img src="fallback.jpg">
    </picture>

Replies

vbezhenaryesterday at 11:07 AM

This problem was solved by HTTP since forever. Client sends `Accept` header with supported formats and server selects the necessary content with corresponding `Content-Type` header. You don't need any HTML tags for it.

show 2 replies