Fandom

HTML & CSS Wiki

@namespace

649pages on
this wiki
Add New Page
Comments0 Share

The CSS @namespace @-rule allows the declaration of a namespace prefix to be used by selectors in a stylesheet. It is associated with a namespace URL. If the optional namespace prefix is omitted, then the URL provided is considered to be the default namespace. This default namespace applies only to selectors that have no explicit namespace prefix declared. Once a namespace prefix is defined though, it can be used in CSS selectors and in property values as well that use element attributes and values.

Any @namespace @-rules in a stylesheet must come after all @import and @charset @-rules and come before all CSS rule sets. If a prefix is declared more than once, the last instance should be used. If a prefix is not understood by the parser in whatever the context, it should be ignored.


Example:

@namespace foo url("http://www.example.com/");

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.