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).
MDN The image-renderingCSS 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.
MDN The image-resolutionCSS 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)
MDN The object-positionCSS 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.
MDN The object-view-boxCSS 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 previewExample 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; }}
<section id="default-example"> <img class="transition-all" id="example-element" src="https://developer.mozilla.org/shared-assets/images/examples/plumeria-146x200.jpg" alt="A close-up of red flowers and buds on a branch." /></section>
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.
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.)
MDN The conic-gradient()CSSfunction 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.
MDN The cross-fade()CSSfunction 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.
MDN The element()CSSfunction 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.
<div id="target-box"> <p>This box uses the element with the #my-background ID as its background!</p></div><div id="background-container"> <div id="my-background"> <p>This text is part of the background. Cool, huh?</p> </div></div>
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.
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()CSSfunctional notation is a method of letting the browser pick the most appropriate CSS image from a given set, primarily for high pixel density screens.
FunctionBaseline: widely availablesince January 2018
MDN The image()CSSfunction 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 previewExample from MDN
ul { list-style-image: image(ltr "rightarrow.png");}
<ul> <li dir="ltr">Bullet is a right facing arrow on the left</li> <li dir="rtl">Bullet is the same arrow, flipped to point left.</li></ul>
Spec The linear-gradient() notation specifies a linear gradient in CSS. Its syntax is as follows:
MDN The linear-gradient()CSSfunction 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.
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()CSSfunction 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.
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()CSSfunction 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).
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()CSSfunction 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.
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()CSSfunction 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.
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.