Baseline Widely available
The CSSLayerBlockRule
represents a @layer
block rule.
Inherits properties from its ancestors CSSGroupingRule
and CSSRule
.
CSSLayerBlockRule.name
Read only
A string containing the name of the associated cascade layer.
Inherits methods from its ancestors CSSGroupingRule
and CSSRule
.
<p>I am displayed in <code>color: rebeccapurple</code>.</p>
CSS
@layer special {
p {
color: rebeccapurple;
}
}
JavaScript
const item = document.getElementsByTagName("p")[0];
const rules = document.styleSheets[1].cssRules;
// Note that stylesheet #1 is the stylesheet associated with this embedded example,
// while stylesheet #0 is the stylesheet associated with the whole MDN page
const layer = rules[0]; // A CSSLayerBlockRule
item.textContent = `The CSSLayerBlockRule is for the "${layer.name}" layer`;
Result Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4