What is srcset — responsive images in HTML
What srcset is: how browsers pick a source from several image URLs, and how to extract those URLs from a page.
srcset lists alternative files for one <img> or <source>, usually with a width (800w) or a pixel density (2x). The browser picks one file for the layout and the screen DPR.
A page can expose a small thumbnail in src and a large file only in srcset. The image parser in ToolsHelper reads both, plus data-srcset used by lazy loaders.
srcset lists candidate image URLs and a width or a pixel density. The browser picks one based on the layout width and the screen density. w descriptors are widths in pixels, such as 800w. x descriptors are densities, such as 2x. Authors sometimes repeat the same photo three times; downloading all of them wastes data. This page defines the attribute. The extractor is what lists those URLs from a page.
FAQ
Is srcset the same as src?
src is the fallback URL. srcset is the menu of sizes the browser may choose from.
Why is the preview small but the link large?
The gallery may show a thumbnail while the copied URL is the 2x or 1200w candidate.
