CSSImportRule: styleSheet-Eigenschaft
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Die schreibgeschützte styleSheet
-Eigenschaft der
CSSImportRule
-Schnittstelle gibt das durch die
@import
-@-Regel spezifizierte CSS-Stylesheet zurück. Dieses wird in Form eines CSSStyleSheet
-Objekts bereitgestellt.
Wert
Ein CSSStyleSheet
.
Beispiele
Das folgende Stylesheet enthält eine einzelne @import
-Regel. Daher wird das erste Element in der Liste der CSS-Regeln eine CSSImportRule
sein. Die styleSheet
-Eigenschaft gibt das importierte Stylesheet zurück.
@import url("style.css") screen;
let myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].styleSheet); //returns a CSSStyleSheet object
Spezifikationen
Specification |
---|
CSS Object Model (CSSOM) # dom-cssimportrule-stylesheet |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
styleSheet |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support