CSS image-resolution Property
The image-resolution property sets the resolution of images, such as 300dpi or from-image. No browser supports it yet.
Description
The image-resolution property was proposed in CSS Images Level 4 to set the intrinsic resolution of raster images, which controls how large they are displayed by default. A 300dpi photo, for example, could be shown at its physical print size instead of one image pixel per CSS pixel. The from-image keyword would use the resolution stored in the file's metadata, and snap would round to a value that maps image pixels to whole device pixels.
No browser implements it. To serve images for different pixel densities use srcset with x descriptors, or the image-set() function in CSS.
Definition
- Initial value
- 1dppx
- Applies to
- all elements
- Inherited
- yes
- Computed value
- as specified, except with <resolution> possibly altered by snap
- Animatable
- discrete
- JavaScript syntax
- object.style.imageResolution
Syntax
image-resolution: [ from-image || <resolution> ] && snap?;
Values
- from-imageUses the resolution specified in the image file, if any.
- <resolution>An explicit resolution such as
300dpior2dppx. - snapRounds the resolution so that one image pixel maps to a whole number of device pixels.
- initialSets the property to its initial value.
- inheritTakes the computed value of the parent element.
Example
Browser Support
The following information will show you the current browser support for the CSS image-resolution property. Hover over a browser icon to see the version that first introduced support for this CSS property.
Desktop





Tablets & Mobile





