Candidate Recommendation Draft · css-images

CSS Images

6 properties, 12 functions, 2 types defined by this specification, 17 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

image-orientation

Property Baseline: widely availablesince October 2022

MDN The image-orientation CSS property specifies a layout-independent correction to the orientation of an image.

Live preview Example from MDN
#example-element {
  height: inherit;
}

Syntax

from-image | none | [ <angle> || flip ]

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
from-image
Applies to
all elements
Inherited
yes
Percentages
n/a
Computed value
the specified keyword, or an <angle>, rounded and normalized (see text), plus optionally a flip keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting image-orientation
Chrome 81
Edge 81
Firefox 26
Safari 13.1
Chrome Android 81
Safari iOS 13.4

First version with support, from MDN browser-compat-data.

image-rendering

Property Baseline: widely availablesince April 2024 Modern CSS: crisp-edges

MDN The image-rendering CSS property sets an image scaling algorithm. The property applies to an element itself, to any images set in its other properties, and to its descendants.

Live preview Example from MDN
#example-element {
  height: 480px;
  object-fit: cover;
}

Syntax

auto | smooth | high-quality | pixelated | crisp-edges

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
all elements
Inherited
yes
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting image-rendering
Chrome 13
Edge 79
Firefox 3.6
Safari 6
Chrome Android 18
Safari iOS 6

First version with support, from MDN browser-compat-data.

image-resolution

Property Not in any browser yet

MDN The image-resolution CSS property specifies the intrinsic resolution of all raster images used in or on the element. It affects content images such as replaced elements and generated content, and decorative images such as background-image images.

Syntax

[ from-image || <resolution> ] && snap?

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
1dppx
Applies to
all elements
Inherited
yes
Percentages
n/a
Computed value
specified keyword(s) and/or <resolution> (possibly adjusted for snap, see below)
Canonical order
per grammar
Animation type
discrete

object-fit

Property Baseline: widely availablesince July 2022

MDN The object-fit CSS property sets how the content of a replaced element, such as an <img> or <video>, should be resized to fit its container.

Live preview Example from MDN
#example-element {
  height: 100%;
  width: 100%;
  border: 2px dotted #888888;
}

Syntax

fill | none | [contain | cover] || scale-down

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
fill
Applies to
replaced elements
Inherited
no
Percentages
n/a
Computed value
specified keyword(s)
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting object-fit
Chrome 32
Edge 79
Firefox 36
Safari 10
Chrome Android 32
Safari iOS 10

First version with support, from MDN browser-compat-data.

object-position

Property Baseline: widely availablesince July 2022

MDN The object-position CSS property specifies the alignment of the selected replaced element's contents within the element's box. Areas of the box which aren't covered by the replaced element's object will show the element's background.

Live preview Example from MDN
#example-element {
  height: 250px;
  width: 250px;
  object-fit: none;
  border: 1px solid red;
}

Syntax

<position>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
50% 50%
Applies to
replaced elements
Inherited
no
Percentages
refer to width and height of element itself
Computed value
as for background-position
Canonical order
the horizontal component of the <position>, followed by the vertical component
Animation type
as for background-position

Browser support

First browser version supporting object-position
Chrome 32
Edge 79
Firefox 36
Safari 10
Chrome Android 32
Safari iOS 10

First version with support, from MDN browser-compat-data.

object-view-box

Property Limited availability Experimental

MDN The object-view-box CSS property defines a rectangle as a viewable area (viewbox) within a replaced element, enabling the content of the replaced element to be zoomed or panned. It works similarly to the SVG viewBox attribute.

Live preview Example from MDN
#example-element {
  height: 100%;
  width: 100%;
  border: 2px dotted #888888;
}

@supports not (object-view-box: none) {
  body::before {
    content: "Your browser does not support the 'object-view-box' property.";
    color: black;
    background-color: #ffcd33;
    display: block;
    width: 100%;
    text-align: center;
  }
}

Syntax

none | <basic-shape-rect>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
replaced elements
Inherited
no
Percentages
n/a
Computed value
specified keyword, or computed <basic-shape> function
Canonical order
per grammar
Animation type
as <basic-shape> if possible, otherwise discrete

Browser support

First browser version supporting object-view-box
Chrome 104
Edge 104
Firefox No
Safari Preview
Chrome Android 104
Safari iOS No

First version with support, from MDN browser-compat-data.

-webkit-image-set()

Function Not in any browser yet

Spec Implementations must accept -webkit-image-set() as a parse-time alias of image-set(). (It’s a valid value, with identical arguments to image-set(), and is turned into image-set() during parsing.)

conic-gradient()

Function Baseline: widely availablesince May 2023 Modern CSS: Gradient interpolation

MDN The conic-gradient() CSS function creates an image consisting of a gradient with color transitions rotated around a center point (rather than radiating from the center). Example conic gradients include pie charts and color wheels. The result of the conic-gradient() function is an object of the gradient data type, which is a special kind of image.

Live preview Example from MDN
#example-element {
  min-height: 100%;
}

Syntax

conic-gradient( [ <conic-gradient-syntax> ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting conic-gradient()
Chrome 69
Edge 79
Firefox 83
Safari 12.1
Chrome Android 69
Safari iOS 12.2

First version with support, from MDN browser-compat-data.

cross-fade()

Function Limited availability

MDN The cross-fade() CSS function can be used to blend two or more images at a defined transparency. It can be used for many basic image manipulations, such as tinting an image with a solid color or highlighting a particular area of the page by combining an image with a radial gradient.

Live preview Example from MDN
.cross-fade {
  width: 300px;
  height: 300px;
  background-image: -webkit-cross-fade(url("br.png"), url("tr.png"), 75%);
  background-image: cross-fade(url("br.png"), url("tr.png"), 75%);
}

Syntax

cross-fade( <cf-image># )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting cross-fade()
Chrome 17 (-webkit- prefix)
Edge 79 (-webkit- prefix)
Firefox No
Safari 10
Chrome Android 18 (-webkit- prefix)
Safari iOS 9.3

First version with support, from MDN browser-compat-data.

element()

Function Limited availability Experimental

MDN The element() CSS function defines an image value generated from an arbitrary HTML element. This image is live, meaning that if the HTML element is changed, the CSS properties using the resulting value are automatically updated.

Live preview Example from MDN
#target-box {
  width: 400px;
  height: 400px;
  background: -moz-element(#my-background) no-repeat;
}

#background-container {
  overflow: hidden;
  height: 0;
}

#my-background {
  width: 1024px;
  height: 1024px;
  background-image: linear-gradient(to right, red, orange, yellow, white);
}

#my-background p {
  transform-origin: 0 0;
  rotate: 45deg;
  color: white;
}

Syntax

element( <id-selector> )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting element()
Chrome No
Edge No
Firefox 57 (-moz- prefix)
Safari No
Chrome Android No
Safari iOS No

First version with support, from MDN browser-compat-data.

image-set()

Function Baseline: widely availablesince March 2026 Modern CSS: image-set()

Spec Delivering the most appropriate image resolution for a user’s device can be a difficult task. Ideally, images should be in the same resolution as the device they’re being viewed in, which can vary between users. However, other factors can factor into the decision of which image to send; for example, if the user is on a slow mobile connection, they may prefer to receive lower-res images rather than waiting for a large proper-res image to load. The image-set() function allows an author to ignore most of these issues, simply providing multiple resolutions of an image and letting the UA decide which is most appropriate in a given situation.

MDN 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.

Live preview Example from MDN
.box {
  width: 400px;
  height: 200px;
  background-repeat: no-repeat;
  background-size: cover;

  background-image: image-set(
    url("https://mdn.github.io/shared-assets/images/examples/balloons-small.jpg")
      1x,
    url("https://mdn.github.io/shared-assets/images/examples/balloons-landscape.jpg")
      2x
  );
}

Syntax

image-set( <image-set-option># )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting image-set()
Chrome 113
Edge 113
Firefox 89
Safari 17
Chrome Android 113
Safari iOS 17

First version with support, from MDN browser-compat-data.

image()

Function Baseline: widely availablesince January 2018

MDN The image() CSS function defines an image in a similar fashion to the url() function, but with added functionality including specifying the image's directionality, displaying just a part of that image defined by a media fragment, and specifying a solid color as a fallback in case none of the specified images are able to be rendered.

Live preview Example from MDN
ul {
  list-style-image: image(ltr "rightarrow.png");
}

Syntax

image( <image-tags>? [ <image-src>? , <color>? ]! )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting image()
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

linear-gradient()

Function Baseline: widely availablesince January 2018 Modern CSS: Gradient interpolation

Spec The linear-gradient() notation specifies a linear gradient in CSS. Its syntax is as follows:

MDN The linear-gradient() CSS function creates an image consisting of a progressive transition between two or more colors along a straight line. Its result is an object of the gradient data type, which is a special kind of image.

Live preview Example from MDN
#example-element {
  min-height: 100%;
}

Syntax

linear-gradient( [ <linear-gradient-syntax> ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting linear-gradient()
Chrome 26
Edge 12
Firefox 16
Safari 7
Chrome Android 26
Safari iOS 7

First version with support, from MDN browser-compat-data.

radial-gradient()

Function Baseline: widely availablesince January 2018 Modern CSS: Gradient interpolation

Spec The radial-gradient() notation specifies a radial gradient by indicating the center of the gradient (where the 0% ellipse will be) and the size and shape of the ending shape (the 100% ellipse). Color stops are given as a list, just as for linear-gradient(). Starting from the gradient center and progressing towards (and potentially beyond) the ending shape, uniformly-scaled concentric ellipses are drawn and colored according to the specified color stops.

MDN The radial-gradient() CSS function creates an image consisting of a progressive transition between two or more colors that radiate from an origin. Its shape may be a circle or an ellipse. The function's result is an object of the gradient data type, which is a special kind of image.

Live preview Example from MDN
#example-element {
  min-height: 100%;
}

Syntax

radial-gradient( [ <radial-gradient-syntax> ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting radial-gradient()
Chrome 26
Edge 12
Firefox 16
Safari 7
Chrome Android 26
Safari iOS 7

First version with support, from MDN browser-compat-data.

repeating-conic-gradient()

Function Baseline: widely availablesince May 2023 Modern CSS: Gradient interpolation

Spec In addition to linear-gradient(), radial-gradient(), and conic-gradient(), this specification defines repeating-linear-gradient(), repeating-radial-gradient(), and repeating-conic-gradient() values. These notations take the same values and are interpreted the same as their respective non-repeating siblings defined previously.

MDN The repeating-conic-gradient() CSS function creates an image consisting of a repeating gradient (rather than a single gradient) with color transitions rotated around a center point (rather than radiating from the center).

Live preview Example from MDN
#example-element {
  min-height: 100%;
}

Syntax

repeating-conic-gradient( [ <conic-gradient-syntax> ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting repeating-conic-gradient()
Chrome 69
Edge 79
Firefox 83
Safari 12.1
Chrome Android 69
Safari iOS 12.2

First version with support, from MDN browser-compat-data.

repeating-linear-gradient()

Function Baseline: widely availablesince January 2018 Modern CSS: Gradient interpolation

Spec In addition to linear-gradient(), radial-gradient(), and conic-gradient(), this specification defines repeating-linear-gradient(), repeating-radial-gradient(), and repeating-conic-gradient() values. These notations take the same values and are interpreted the same as their respective non-repeating siblings defined previously.

MDN The repeating-linear-gradient() CSS function creates an image consisting of repeating linear gradients. It is similar to linear-gradient() and takes the same arguments, but it repeats the color stops infinitely in all directions so as to cover its entire container. The function's result is an object of the gradient data type, which is a special kind of image.

Live preview Example from MDN
#example-element {
  min-height: 100%;
}

Syntax

repeating-linear-gradient( [ <linear-gradient-syntax> ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting repeating-linear-gradient()
Chrome 26
Edge 12
Firefox 16
Safari 7
Chrome Android 26
Safari iOS 7

First version with support, from MDN browser-compat-data.

repeating-radial-gradient()

Function Baseline: widely availablesince January 2018 Modern CSS: Gradient interpolation

Spec In addition to linear-gradient(), radial-gradient(), and conic-gradient(), this specification defines repeating-linear-gradient(), repeating-radial-gradient(), and repeating-conic-gradient() values. These notations take the same values and are interpreted the same as their respective non-repeating siblings defined previously.

MDN The repeating-radial-gradient() CSS function creates an image consisting of repeating gradients that radiate from an origin. It is similar to radial-gradient() and takes the same arguments, but it repeats the color stops infinitely in all directions so as to cover its entire container, similar to repeating-linear-gradient(). The function's result is an object of the gradient data type, which is a special kind of image.

Live preview Example from MDN
#example-element {
  min-height: 100%;
}

Syntax

repeating-radial-gradient( [ <radial-gradient-syntax> ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting repeating-radial-gradient()
Chrome 26
Edge 12
Firefox 16
Safari 7
Chrome Android 26
Safari iOS 7

First version with support, from MDN browser-compat-data.

stripes()

Function Not in any browser yet

Spec The stripes() function defines a 1D image as a comma-separated list of colored stripes, each placed end-to-end on the paint line in the order given.

Syntax

stripes( <color-stripe># )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

<gradient>

Type Baseline: widely availablesince January 2018

MDN The <gradient> CSS data type is a special type of image that consists of a progressive transition between two or more colors.

Live preview Example from MDN
#example-element {
  min-height: 100%;
}

Syntax

[ <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()> | <repeating-conic-gradient()> ]

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting <gradient>
Chrome 26
Edge 12
Firefox 3.6
Safari 7
Chrome Android 26
Safari iOS 7

First version with support, from MDN browser-compat-data.

<image>

Type Baseline: widely availablesince January 2018

MDN The <image> CSS data type represents a two-dimensional image.

Syntax

<url> | <image()> | <image-set()> | <cross-fade()> | <element()> | <gradient>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting <image>
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.