Selectors
Available selectors
The list of default selectors supported by CSSelly:
*any elementEan element of type EE[foo]an E element with a "foo" attributeE[foo="bar"]an E element whose "foo" attribute value is exactly equal to "bar"E[foo~="bar"]an E element whose "foo" attribute value is a list of whitespace-separated values, one of which is exactly equal to "bar"E[foo^="bar"]an E element whose "foo" attribute value begins exactly with the string "bar"E[foo$="bar"]an E element whose "foo" attribute value ends exactly with the string "bar"E[foo*="bar"]an E element whose "foo" attribute value contains the substring "bar"E[foo|="en"]an E element whose "foo" attribute has a hyphen-separated list of values beginning (from the left) with "en"E:rootan E element, root of the documentE:nth-child(n)an E element, the n-th child of its parentE:nth-last-child(n)an E element, the n-th child of its parent, counting from the last oneE:nth-of-type(n)an E element, the n-th sibling of its typeE:nth-last-of-type(n)an E element, the n-th sibling of its type, counting from the last oneE:first-childan E element, first child of its parentE:last-childan E element, last child of its parentE:first-of-typean E element, first sibling of its typeE:last-of-typean E element, last sibling of its typeE:only-childan E element, only child of its parentE:only-of-typean E element, only sibling of its typeE:emptyan E element that has no children (including text nodes)E#myidan E element with ID equal to “myid”.E Fan F element descendant of an E elementE > Fan F element child of an E elementE + Fan F element immediately preceded by an E elementE ~ Fan F element preceded by an E element
The list of additional pseudo-classes and pseudo-functions supported by CSSelly:
:first:last:button:checkbox:file:header:image:input:parent:password:radio:reset:selected:checked:submit:text:even:odd:eq(n):gt(n):lt(n):contains(text)
Escaping
CSSelly supports escaping characters using the backslash, e.g.: nspace\:name refers to the tag name nspace:name (that uses namespaces) and not for pseudo-class name.
Last updated
Was this helpful?