GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — CSSLayerBlockRule - Web APIs | MDN

CSSLayerBlockRule

Baseline
Widely available

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

  • See full compatibility
  • Learn more

The CSSLayerBlockRule represents a @layer block rule.

Instance properties

Inherits properties from its ancestors CSSGroupingRule and CSSRule.

CSSLayerBlockRule.name Read only

A string containing the name of the associated cascade layer.

Instance methods

Inherits methods from its ancestors CSSGroupingRule and CSSRule.

Examples

HTML

html
<p>I am displayed in <code>color: rebeccapurple</code>.</p>

CSS

css
@layer special {
  p {
    color: rebeccapurple;
  }
}

JavaScript

js
const item = document.getElementsByTagName("p")[0];
const rules = document.getElementById("css-output").sheet.cssRules;

const layer = rules[0]; // A CSSLayerBlockRule

item.textContent = `The CSSLayerBlockRule is for the "${layer.name}" layer`;

Result

Specifications

Specification
CSS Cascading and Inheritance Level 5
# csslayerblockrule

Browser compatibility

See also

  • @layer
  • CSSLayerStatementRule
  • Learn CSS cascade layers

Help improve MDN

Learn how to contribute

This page was last modified on Nov 10, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.