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.

CSS インターフェイス は CSS に関連した便利なメソッドを持っています。このインターフェイスにはオブジェクトは実装されていません。静的メソッドのみがあり、実用的なインターフェイスになっています。

静的プロパティ

CSS.highlights Experimental

HighlightRegistry へのアクセスを提供します。これは任意のテキスト範囲を CSS Custom Highlight API を使用してスタイル設定するために使用するものです。

CSS.paintWorklet Experimental 安全なコンテキスト用

描画に関するすべてのクラスを担当するワークレットへのアクセスを提供します。

メソッド

CSS インターフェイスはユーティリティインターフェイスです。この型のオブジェクトは作成できません。静的メソッドのみが定義されています。

静的メソッド

継承している静的メソッドはありません。

CSS.registerProperty()

カスタムプロパティを登録し、プロパティ型のチェック、既定値、値の継承の有無を指定します。

CSS.supports()

引数で与えられたプロパティと値の組や条件に対応しているかどうかを示す論理値を返します。

CSS.escape()

主に CSS セレクターの一部として使用するための文字列をエスケープするのに使用できます。

CSS ファクトリー関数

使用したファクトリー関数のメソッドの名前を単位としてパラメーターの数値の値を持つ新しい CSSUnitValue を返すために使用できます。

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

インスタンスメソッド

CSS インターフェイスはユーティリティインターフェイスです。この型のオブジェクトは作成できません。静的プロパティのみが定義されています。

仕様書

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

ブラウザーの互換性

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.