image-set()
The image-set() CSS function provides a set of images at different resolutions or pixel densities, which the browser can pick from, depending on the device capabilities.
Overview
The image-set() CSS function provides a set of images at different resolutions or pixel densities, which the browser can pick from, depending on the device capabilities.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 113 | 113 | 89 | 17 | 113 | 17 | |
| CSS property | ||||||
| The image-set() CSS functional notation is a method of letting the browser pick the most appropriate CSS image from a given set, primarily for high pixel density screens. | 113 | 113 | 89 | 17 | 113 | 17 |
| CSS type | ||||||
| The image-set() CSS functional notation is a method of letting the browser pick the most appropriate CSS image from a given set, primarily for high pixel density screens. | 113 | 113 | 89 | 17 | 113 | 17 |
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (20)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (79)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- This browser only partially implements this feature
- This feature was removed in a later browser version (89)
- The `type()` function is not supported as an argument to `image-set()`.
- Available with a vendor prefix: -webkit- (90)
- This browser only partially implements this feature
- This feature was removed in a later browser version (17)
- This feature was removed in a later browser version (14)
- The `type()` function is not supported as an argument to `image-set()`.
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (17)
- Available with a vendor prefix: -webkit- (14)
- Available with a vendor prefix: -webkit- (6)
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (25)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- This browser only partially implements this feature
- This feature was removed in a later browser version (17)
- This feature was removed in a later browser version (14)
- The `type()` function is not supported as an argument to `image-set()`.
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (17)
- Available with a vendor prefix: -webkit- (14)
- Available with a vendor prefix: -webkit- (6)
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (20)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (79)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- This browser only partially implements this feature
- This feature was removed in a later browser version (89)
- The `type()` function is not supported as an argument to `image-set()`.
- Available with a vendor prefix: -webkit- (90)
- This browser only partially implements this feature
- This feature was removed in a later browser version (17)
- This feature was removed in a later browser version (14)
- The `type()` function is not supported as an argument to `image-set()`.
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (17)
- Available with a vendor prefix: -webkit- (14)
- Available with a vendor prefix: -webkit- (6)
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (25)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- This browser only partially implements this feature
- This feature was removed in a later browser version (17)
- This feature was removed in a later browser version (14)
- The `type()` function is not supported as an argument to `image-set()`.
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (17)
- Available with a vendor prefix: -webkit- (14)
- Available with a vendor prefix: -webkit- (6)
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (20)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (79)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- This browser only partially implements this feature
- This feature was removed in a later browser version (89)
- The `type()` function is not supported as an argument to `image-set()`.
- Available with a vendor prefix: -webkit- (90)
- This browser only partially implements this feature
- This feature was removed in a later browser version (17)
- This feature was removed in a later browser version (14)
- The `type()` function is not supported as an argument to `image-set()`.
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (17)
- Available with a vendor prefix: -webkit- (14)
- Available with a vendor prefix: -webkit- (6)
- Available with a vendor prefix: -webkit- (113)
- Available with a vendor prefix: -webkit- (25)
- This browser only partially implements this feature
- This feature was removed in a later browser version (113)
- Support for `url` images only and `x` is the only supported resolution unit.
- This browser only partially implements this feature
- This feature was removed in a later browser version (17)
- This feature was removed in a later browser version (14)
- The `type()` function is not supported as an argument to `image-set()`.
- Support for `url` images only and `x` is the only supported resolution unit.
- Available with a vendor prefix: -webkit- (17)
- Available with a vendor prefix: -webkit- (14)
- Available with a vendor prefix: -webkit- (6)
Syntax
.hero {
background-image: image-set(
url('bg-1x.jpg') 1x,
url('bg-2x.jpg') 2x
);
} Live demo
Use cases
Using image-set()
The image-set() CSS function provides a set of images at different resolutions or pixel densities, which the browser can pick from, depending on the device capabilities.
Cautions
- May not be supported in older browsers.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.
Related links
Powered by web-features