← BYTES
HTML·Intermediate·Ref: 2.2.10
What is the purpose of the `srcset` attribute on an `<img>` tag?
Have a question about this video? Mention reference 2.2.10 when you contact us.
a.It specifies alternative text if the image fails to load
b.It defines the image's border styling
c.It sets a fallback image source if the primary src fails
d.It provides the browser with multiple versions of an image at different resolutions/widths, letting it choose the most appropriate one to download based on the device's screen size and pixel density
srcset lists several image file candidates along with their intrinsic widths (or pixel-density descriptors), and the browser itself decides which one to actually download based on the viewport size, pixel density, and (optionally) layout hints from the related sizes attribute -- a core responsive-images technique that avoids sending oversized images to small/low-density screens.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES2210#HTML