I’ve been meaning to check out the more complex selectors in CSS 2.1 for a long time but never seemed to find the time to experiment. So having some downtime the other day I thought I should get constructive.
Descendant selectors seem well used in CSS these days and are a powerful way to target HTML elements within the page (for e.g. div.message p, which targets all p tags within div elements that have a class of ‘message’). It’s a good way to keep your HTML as clean as possible because it reduces the need to give every element on the page a unique id or a class for targeting purposes. And they’re well supported in all the major browsers that I usually test with – Firefox, Safari, Opera, and IE down to 5.0.