-
Notifications
You must be signed in to change notification settings - Fork 23.2k
What css calculation functions are supported in the sizes attribute of the html img tag #37966
Description
MDN URL
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
What specific section or headline is this issue about?
The sizes attribute
What information was incorrect, unhelpful, or incomplete?
Its not clear whether css calculation funtions (calc, clamp etc) are supported in the sizes attribute of the html img tag.
There are plenty of blog posts and stack overflow questions where they do this, so I assume that it is at least partially supported, but I can't find any documentation that specifies it.
It is also a bit unclear what css units can be used, and what they mean in this context (I think em and rem are the same in this context for example, but they wouldn't be in corresponding css)
What did you expect to see?
A statement specifying which css calculation functions are supported, if any.
A statement specifying which css size units are supported, and any caveats (such as em and other font related sizes)
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/web/html/element/img - MDN URL: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/html/element/img/index.md
- Last commit: 27bceea
- Document last modified: 2025-02-03T15:11:02.000Z