CSS

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.

* Some parts of this feature may have varying levels of support.

Das CSS-Interface enthält nützliche CSS-bezogene Methoden. Es gibt keine Objekte mit diesem Interface: Es enthält nur statische Methoden und ist daher ein utilitäres Interface.

Statische Eigenschaften

CSS.highlights

Bietet Zugriff auf das HighlightRegistry, das verwendet wird, um beliebige Textbereiche mit der CSS Custom Highlight API zu stylen.

CSS.paintWorklet Experimentell Sicherer Kontext

Bietet Zugriff auf das Worklet, das für alle Klassen verantwortlich ist, die mit dem Malen zu tun haben.

Instanzeigenschaften

Das CSS-Interface ist ein Dienstleistungsinterface und es kann kein Objekt dieses Typs erstellt werden: Es sind nur statische Eigenschaften darauf definiert.

Statische Methoden

Keine geerbten statischen Methoden.

CSS.registerProperty()

Registriert benutzerdefinierte Eigenschaften und ermöglicht das Prüfen von Eigenschaftstypen, Standardwerten und Eigenschaften, die ihren Wert erben oder nicht.

CSS.supports()

Gibt einen booleschen Wert zurück, der angibt, ob das Paar Eigenschaft-Wert oder die Bedingung, die im Parameter gegeben ist, unterstützt wird.

CSS.escape()

Kann verwendet werden, um einen String zu escapen, hauptsächlich für die Verwendung als Teil eines CSS-Selektors.

CSS-Factory-Funktionen

Kann verwendet werden, um einen neuen CSSUnitValue mit einem Wert der angegebenen Anzahl von Einheiten des Namens der verwendeten Factory-Funktionsmethode zurückzugeben.

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

Instanzmethoden

Das CSS-Interface ist ein Dienstleistungsinterface und es kann kein Objekt dieses Typs erstellt werden: Es sind nur statische Methoden darauf definiert.

Spezifikationen

Specification
CSS Object Model (CSSOM)
# namespacedef-css
CSS Properties and Values API Level 1

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
CSS
Hz() static method
Q() static method
cap() static method
ch() static method
cm() static method
cbq() static method
cqh() static method
cqi() static method
cqmax() static method
cqmin() static method
cqw() static method
deg() static method
dpqm() static method
dpi() static method
dppx() static method
dvb() static method
dvh() static method
dvi() static method
dvmax() static method
dvmin() static method
dvw() static method
em() static method
escape() static method
ex() static method
fr() static method
grad() static method
highlights static property
ic() static method
in() static method
kHz() static method
lh() static method
lvb() static method
lvh() static method
lvi() static method
lvmax() static method
lvmin() static method
lvw() static method
mm() static method
ms() static method
number() static method
paintWorklet static property
Experimental
pc() static method
percent() static method
pt() static method
px() static method
rad() static method
rcap() static method
rch() static method
registerProperty() static method
rem() static method
rex() static method
ric() static method
rlh() static method
s() static method
supports() static method
Parentheses for single-argument version are optional.
svb() static method
svh() static method
svi() static method
svmax() static method
svmin() static method
svw() static method
turn() static method
vb() static method
vh() static method
vi() static method
vmax() static method
vmin() static method
vw() static method

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.