Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. CSSNamespaceRule
  4. namespaceURI

CSSNamespaceRule: namespaceURI property

Baseline Widely available

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

The read-onlynamespaceURI property of theCSSNamespaceRule returns a string containing the text of the URI of the given namespace.

Value

A string containing a URI.

Examples

The stylesheet includes a namespace as the only rule. Therefore the firstCSSRule returned will be aCSSNamespaceRule. The value of thenamespaceURI property will behttp://www.w3.org/1999/xhtml.

css
@namespace url("http://www.w3.org/1999/xhtml");
js
const myRules = document.styleSheets[0].cssRules;console.log(myRules[0].namespaceURI); // 'http://www.w3.org/1999/xhtml'

Specifications

Specification
CSS Object Model (CSSOM)
# dom-cssnamespacerule-namespaceuri

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp