at-rule

@namespace — CSS reference

Binds a CSS namespace prefix to a namespace URI for qualified selectors. It does not load the URI or change element namespaces. Place the rule before ordinary style rules and after imports. This distinguishes an SVG element from same-named HTML elements.

Formal Syntax & Structure

css syntaxcss
@namespace svg url("http://www.w3.org/2000/svg");

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>@namespace</title><style>
@namespace svg url("http://www.w3.org/2000/svg"); svg|a{fill:red} a{color:green}</style><body><svg width="100" height="40"><a id="a"><text y="20">SVG</text></a></svg><a id="b" href="#b">HTML</a></body></html>
CSS Reference