| Expression | Name | CSS Level | Description / Example |
|---|---|---|---|
| * | Universal selector | CSS Level 2 | Matches any element |
| E | Type selector | CSS Level 2 | Matches any E element (i. e. an element with the local name E) |
| E F | Descendant selector | CSS Level 2 | Matches any F element that is a descendant of an E element. |
| E > F | Child selectors | CSS Level 2 | Matches any F element that is a child of an element E. |
| E:lang(c) | Language pseudo-class | CSS Level 2 | Matches element of type E if it is in (human) language c (the document language specifies how language is determined). |
| E + F | Adjacent selector | CSS Level 2 | Matches any F element immediately preceded by a sibling element E. |
| E ~ F | General sibling selector | CSS Level 3 | Matches any F element preceded by a sibling element E. |
| E[foo] | Attribute selector | CSS Level 2 | Matches any E element with the "foo" attribute set (whatever the value). |
| E[foo="warning"] | Attribute selector with value | CSS Level 2 | Matches any E element whose "foo" attribute value is exactly equal to "warning". |
| E[foo~="warning"] | Attribute selector containing value | CSS Level 2 | Matches any E element whose "foo" attribute value is a list of space-separated values, one of which is exactly equal to "warning". |
| E[lang|="en"] | Attribute selector containing hyphen separated values | CSS Level 2 | Matches any E element whose "lang" attribute has a hyphen-separated list of values beginning (from the left) with "en". |
| E:before and E:after | Pseudo elements | CSS Level 2 | The ':before' and ':after' pseudo-elements can be used to insert generated content before or after an element's content. |
| E:before(n) and E:after(n) | Pseudo elements | CSS Level 3 | Multiple ':before(n)' and ':after(n)'
pseudo-elements can be used to insert content before or after the content of an element
(or other pseudo-element). For more information, see the W3C CSS3 pseudo elements site. |
| E:first-child | The first-child pseudo-class | CSS Level 2 | Matches element E when E is the first child of its parent. |
| E:not(s) | Negation pseudo-class | CSS Level 2 |
An E element that does not match simple selector s. |
| E:hover | The hover pseudo-class | CSS Level 2 |
The :hover pseudo-class applies while the user designates an element with a pointing device, but does not necessarily activate it. When moving the pointing device over an element, all the parent elements up to the root are taken into account. |
| E:focus | The focus pseudo-class | CSS Level 2 |
The :focus pseudo-class applies while an element has the focus (accepts keyboard input). |
| E#myid | The ID selector | CSS Level 2 |
Matches any E element with ID equal to "myid".
Important: Limitation: In
Oxygen XML Editor the match is performed taking into account only the attributes with the exact
name: "id".
|
| E[att^="val"] | Substring matching attribute selector | CSS Level 3 | An E element whose att attribute value begins exactly with the string val. |
| E[att$="val"] | Substring matching attribute selector | CSS Level 3 | An E element whose att attribute value ends exactly with the string val. |
| E[att*="val"] | Substring matching attribute selector | CSS Level 3 | An E element whose att attribute value contains the substring val. |
| E:root | Root pseudo-class | CSS Level 3 | Matches the root element of the document. In HTML, the root element is always the HTML element. |
| E:empty | Empty pseudo-class | CSS Level 3 | An E element which has no text or child elements. |
| E:nth-child(n) | The nth-child pseudo-class | CSS Level 3 | An E element, the nth child of its parent. |
| E:nth-last-child(n) | The nth-last-child pseudo-class | CSS Level 3 |
An E element, the nth child of its parent, counting from the last one. |
| E:nth-of-type(n) | The nth-of-type pseudo-class | CSS Level 3 |
An E element, the nth sibling of its type. |
| E:nth-last-of-type(n) | The nth-last-of-type pseudo-class | CSS Level 3 |
An E element, the nth sibling of its type, counting from the last one. |
| E:last-child | The last-child pseudo-class | CSS Level 3 |
An E element, last child of its parent. |
| E:first-of-type | The first-of-type pseudo-class | CSS Level 3 |
An E element, first sibling of its type. |
| E:last-of-type | The last-of-type pseudo-class | CSS Level 3 |
An E element, last sibling of its type. |
| E:only-child | The only-child pseudo-class | CSS Level 3 |
An E element, only child of its parent. |
| E:only-of-type | The only-of-type pseudo-class | CSS Level 3 |
An E element, only sibling of its type. |
| ns|E | Element namespace selector | CSS Level 3 |
An element that has the local name E and the namespace given by the prefix ns. The
namespace prefix can be bound to an URI by the
at-rule:
@namespace ns "http://some_namespace_uri";
See
Namespace Selector. |
| E!>F | The subject selector | CSS Level 4 (experimental) |
An element that has the local name E and has a child F. See Subject Selector. |