CSS Data Type
Description
The <image> CSS data type represents a reference to an image resource that can be used in various CSS properties to display graphical content. This type encompasses multiple formats, including raster images like PNG, JPEG, GIF, and SVG images. The <image> data type allows developers to specify an external or inline image that will be rendered in the browser. Common CSS properties that accept <image> include background-image, list-style-image, and content, providing flexibility in visual presentation.
When using <image>, you can refer to images through URLs, including relative paths, absolute paths, or data URIs. Inline images using data URIs are especially useful for embedding small graphics directly into stylesheets without additional network requests. This capability ensures that images can be used consistently in various contexts, such as icons in pseudo-elements or decorative backgrounds.
A key feature of the <image> type is that it can accept gradients or patterns in certain contexts. For instance, the background-image property can use CSS gradients as a valid <image> value, which allows combining photographic content and programmatically generated visuals. However, it’s important to note that not all <image> values are supported across every property, so checking property-specific documentation is crucial.
Code examples:
/* Using a raster image as a background */
div.hero {
background-image: url('images/hero.jpg');
background-size: cover;
background-position: center;
}
/* Using an SVG image as content in a pseudo-element */
button::before {
content: url('icons/check.svg');
margin-right: 8px;
}
/* Using a linear gradient as an <image> value */
div.banner {
background-image: linear-gradient(to right, #ff7e5f, #feb47b);
}
In these examples, <image> demonstrates its versatility, allowing both external files and generated images to enhance visual design. It can also interact with layout properties like background-size or background-repeat to control rendering and positioning.
Syntax
property: <image>;
Values
- <image>Represents a reference to an image file.
Example
Browser Support
The following information will show you the current browser support for the CSS image data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
This data type is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 2nd January 2026
