Skip to content

Document img auto-sizes #30596

@zcorpan

Description

@zcorpan

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes

What specific section or headline is this issue about?

Value

What information was incorrect, unhelpful, or incomplete?

The auto keyword is not documented.

What did you expect to see?

The auto keyword can be used for lazy-loaded images. This makes the browser use the rendered width of the image as the computed sizes value for selecting a candidate in srcset. The value must be exactly auto (case-insensitive) or start with auto, (case-insensitive). The width and height attributes should be used when using auto. The browser's default style will force size containment (so that the rendered size is not affected by loading the image) and contain-intrinsic-size will be 300px 150px (this can be overridden by author CSS or the width/height attributes).

When using auto-sizes with picture, the auto keyword is required on the img element. The sizes attribute can be omitted on source elements.

Do you have any supporting links, references, or citations?

whatwg/html#8008
whatwg/html#9493

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions