files/en-us/web/api/cssnamespacerule/index.md
{{APIRef("CSSOM")}}
The CSSNamespaceRule interface describes an object representing a single CSS {{ cssxref("@namespace") }} at-rule.
{{InheritanceDiagram}}
Inherits properties from its ancestor {{domxref("CSSRule")}}.
Inherits methods from its ancestor {{domxref("CSSRule")}}.
The stylesheet includes a namespace as the only rule. Therefore the first {{domxref("CSSRule")}} returned will be a CSSNamespaceRule.
@namespace url("http://www.w3.org/1999/xhtml");
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); // A CSSNamespaceRule
{{Specifications}}
{{Compat}}