Child Selector

From CSS Discuss

Jump to: navigation, search

Child Selectors (not parent selectors) look like this, and are generally less well supported than Descendant Selectors:


The above selector matches this em element, which is a child of the p element:


But not this em element, which is a descendant of the p element (and a child of the q element):


The descendant selector, like this:

   p em

Would match both em elements, since children are descendants:



Support for child selectors is not terribly good, which gives rise to the Child Hack.

Category Selector

Personal tools