Export (0) Print
Expand All

Namespaced (|) selector

Matches the elements within the namespace specified by the given namespace prefix.

CSS Namespaces Module, Section 4Internet Explorer 9

 

Syntax

prfx|selector {...}

Parameters

prfx

A namespace prefix. The namespace prefix is declared by the @namespace at-rule.

selector

A local element or attribute name.

Standards information

Remarks

A CSS qualified name is an element or attribute name that is located within a namespace. To form a qualified name, first declare a namespace prefix by using the @namespace at-rule. Then, prepend the namespace prefix to the element or attribute name, separating the prefix and the name with a vertical bar (|).

Type, universal, and attribute selectors can be namespaced, as shown in Examples.

Examples

Type selectors allow an optional namespace component (namespace prefix). The namespace prefix can be left empty to indicate that the selector is only to match elements with no namespace, or an asterisk can be used to indicate that the selector matches elements in any namespace (as well as elements with no namespace).

First, declare the namespace prefix (myprfx in this example):


@namespace myprfx url(http://www.microsoft.com);

Next, include the namespace prefix in the selector. The following

 

 

Show:
© 2014 Microsoft