CSSSupportsRule
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.
Instanzeigenschaften
Erbt Eigenschaften von seinen Vorfahren CSSConditionRule
, CSSGroupingRule
, und CSSRule
.
Instanzmethoden
Erbt Methoden von seinen Vorfahren CSSConditionRule
, CSSGroupingRule
, und CSSRule
.
Beispiele
Das CSS enthält eine CSS-Feature-Abfrage mit der @supports
-At-Regel, die eine einzige Stilregel beinhaltet. Dies wird die erste CSSRule
sein, die durch document.styleSheets[0].cssRules
zurückgegeben wird.
myRules[0]
gibt daher ein CSSSupportsRule
-Objekt zurück.
@supports (display: grid) {
body {
color: blue;
}
}
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); // a CSSSupportsRule representing the feature query.
Spezifikationen
Specification |
---|
CSS Conditional Rules Module Level 3 # the-csssupportsrule-interface |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CSSSupportsRule |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Has more compatibility info.