Responsive images - srcset and sizes attribute - how to use both correctly: device-pixel-ratio-based and viewport-based selection together?
问题 I have read about this problem quite often so far and it also occurs for my own projects. Here is an introduction of what I have found out so far about the srcset and the sizes attribte. There are two different possibilities on how to use the srcset -attribute (source w3c: http://w3c.github.io/html/semantics-embedded-content.html#device-pixel-ratio): Device-pixel-ratio-based selection when the rendered size of the image is fixed This is a simple and reliable way to use srcset . You simply say