@namespace CSS At-Rule
Description
The @namespace
CSS at-rule declares a namespace prefix and associates it with a given namespace name. It can also be used to declare a (non-prefixed) default namespace.
Syntax
namespace <namespace-prefix>? [ <string> | <url> ]; where <namespace-prefix> = <ident>
Values
- none
Example
@namespace url(http://www.w3.org/1999/xhtml);
@namespace svg url(http://www.w3.org/2000/svg);
/* This matches all XHTML elements, as XHTML is the default unprefixed namespace */
a {}
/* This matches all SVG elements */
svg|a {}
/* This matches both XHTML and SVG elements */
*|a {}
Browser Support
Desktop | |||||
9 | 12 | 1 | 1 | 8 | 1 |
Tablets / Mobile | |||||
![]() |
|||||
37 | 18 | 4 | X | 1 | X |
Last updated by CSSPortal on: 1st December 2019