W3cubDocs

/Web APIs

CSS

The CSS interface holds useful CSS-related methods. No objects with this interface are implemented: it contains only static methods and is therefore a utilitarian interface.

Static properties

CSS.highlights Experimental

Provides access to the HighlightRegistry used to style arbitrary text ranges using the CSS Custom Highlight API.

CSS.paintWorklet Experimental Secure context

Provides access to the Worklet responsible for all the classes related to painting.

Instance properties

The CSS interface is a utility interface and no object of this type can be created: only static properties are defined on it.

Static methods

No inherited static methods.

CSS.registerProperty()

Registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.

CSS.supports()

Returns a boolean value indicating if the pair property-value, or the condition, given in parameter is supported.

CSS.escape()

Can be used to escape a string mostly for use as part of a CSS selector.

CSS factory functions

Can be used to return a new CSSUnitValue with a value of the parameter number of the units of the name of the factory function method used.

CSS.em(3); // CSSUnitValue {value: 3, unit: "em"}

Instance methods

The CSS interface is a utility interface and no object of this type can be created: only static methods are defined on it.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
Hz 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
Q 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
CSS 28 12 22 No 15 9 4.4 28 22 15 9 1.5
ch 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
cm 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
cqb 105 105 No No 91 16.4 105 105 No 72 16.4 20.0
cqh 105 105 No No 91 16.4 105 105 No 72 16.4 20.0
cqi 105 105 No No 91 16.4 105 105 No 72 16.4 20.0
cqmax 105 105 No No 91 16.4 105 105 No 72 16.4 20.0
cqmin 105 105 No No 91 16.4 105 105 No 72 16.4 20.0
cqw 105 105 No No 91 16.4 105 105 No 72 16.4 20.0
deg 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
dpcm 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
dpi 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
dppx 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
dvb 108 108 No No 94 16.4 108 108 No 73 16.4 No
dvh 108 108 No No 94 16.4 108 108 No 73 16.4 No
dvi 108 108 No No 94 16.4 108 108 No 73 16.4 No
dvmax 108 108 No No 94 16.4 108 108 No 73 16.4 No
dvmin 108 108 No No 94 16.4 108 108 No 73 16.4 No
dvw 108 108 No No 94 16.4 108 108 No 73 16.4 No
em 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
escape 46 79 31 No 33 10.1 46 46 31 33 10.3 5.0
ex 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
fr 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
grad 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
highlights 105 105 No No 91 No 105 105 No 72 No 20.0
in 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
kHz 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
lvb 108 108 No No 94 16.4 108 108 No 73 16.4 No
lvh 108 108 No No 94 16.4 108 108 No 73 16.4 No
lvi 108 108 No No 94 16.4 108 108 No 73 16.4 No
lvmax 108 108 No No 94 16.4 108 108 No 73 16.4 No
lvmin 108 108 No No 94 16.4 108 108 No 73 16.4 No
lvw 108 108 No No 94 16.4 108 108 No 73 16.4 No
mm 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
ms 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
number 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
paintWorklet 65 79 No No 52 No 65 65 No 47 No 9.0
pc 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
percent 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
pt 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
px 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
rad 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
registerProperty 78 79 No No 65 16.4 78 78 No 56 16.4 12.0
rem 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
s 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
supports 61
28–61The parentheses-less one-argument version is not supported.
79
12–79The parentheses-less one-argument version is not supported.
55
22–55The parentheses-less one-argument version is not supported.
No 48
15–48The parentheses-less one-argument version is not supported.
11
9–11The parentheses-less one-argument version is not supported.
61
4.4–61The parentheses-less one-argument version is not supported.
61
28–61The parentheses-less one-argument version is not supported.
55
22–55The parentheses-less one-argument version is not supported.
45
15–45The parentheses-less one-argument version is not supported.
11
9–11The parentheses-less one-argument version is not supported.
8.0
1.5–8.0The parentheses-less one-argument version is not supported.
svb 108 108 No No 94 16.4 108 108 No 73 16.4 No
svh 108 108 No No 94 16.4 108 108 No 73 16.4 No
svi 108 108 No No 94 16.4 108 108 No 73 16.4 No
svmax 108 108 No No 94 16.4 108 108 No 73 16.4 No
svmin 108 108 No No 94 16.4 108 108 No 73 16.4 No
svw 108 108 No No 94 16.4 108 108 No 73 16.4 No
turn 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
vb 108 108
NoSee bug 1287034.
No 94
16.4See bug 159801.
108 108
NoSee bug 1287034.
73
16.4See bug 159801.
No
vh 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
vi 108 108
NoSee bug 1287034.
No 94
16.4See bug 159801.
108 108
NoSee bug 1287034.
73
16.4See bug 159801.
No
vmax 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
vmin 66 79 No No 53 16.4 66 66 No 47 16.4 9.0
vw 66 79 No No 53 16.4 66 66 No 47 16.4 9.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CSS