CSS <image> Data Type

Description

The <image> CSS data type represents graphical content. Images are usually specified with the url() function, but may also be created with a gradient function. Other syntaxes are defined but not widely implemented.
In CSS, images may be used as property values for backgrounds, borders, custom list bullets and for pseudo-element content. The <image> data type was introduced in CSS3; in CSS 2.1 and earlier the only way to specify an image was with the url() function and so the <uri> data type was sufficient.

Syntax

property: <image>;

Values

  • <image>Represents a reference to an image file.

Example

<div></div>
div {
   width: 300px;
   height: 226px;
   background-image: url('images/sunset.jpg');
   margin: 10px;
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
10121121
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
11841111.0

Last updated by CSSPortal on: 9th December 2019