Advanced CSS selectors

> means “is a child element of“. So body > *:not(.toolbar) matches *:not(.toolbar) that is a child of body.

*:not(.toolbar) matches any element that does not have the class .toolbar.

*[selected="true"] matches any element with the selected attribute equal to true.

Keep in mind that the last two (*:not() and *[] are part of the CSS3 spec and you usually can’t rely on them for cross-browser CSS compatibility. They are, however, fully supported in WebKit.

Leave a Reply

Your email address will not be published. Required fields are marked *