HTML & CSS Wiki
Advertisement

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/");
Advertisement