HTML Attributes

HTML imagesizes attribute

Supplies source-size information for an image preload, corresponding to the sizes on the eventual image. Use with imagesrcset where width descriptors require it. Applicable elements include: <link>. Check each element’s value rules. Example uses illustrative URLs or local assets; provide the corresponding files or application endpoints when running it.

Formal Syntax & Structure

html syntaxhtml
imagesizes="100vw"

Parameters & Attributes

NameTypeDescription
imagesizesresponsive source size listSupplies source-size information for an image preload, corresponding to the sizes on the eventual image. Use with imagesrcset where width descriptors require it.

Working Example

Example Snippethtml
<link rel="preload" as="image" imagesrcset="small.jpg 400w, large.jpg 800w" imagesizes="100vw">
HTML Reference