pseudo-class

:xr overlay — CSS reference

Matches the element designated as the DOM overlay in an immersive WebXR session. This selector does not itself create a session or grant access to XR devices. The ordinary element remains visible outside a session.

Formal Syntax & Structure

css syntaxcss
:xr-overlay { background: black; }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>:xr-overlay</title><style>body{margin:8px;font:16px/20px sans-serif;color:black;background:white}#a{background:white}#a:xr-overlay{background:black}</style><body><p id="a">Example text</p></body></html>
CSS Reference