HTML and CSS Reference
Using traditional approaches, you would have to apply classes to each
element. For the previous three examples, the code would be some-
thing like the following, where the class names don't add any further
meaning to the markup—they just make explicit relationships that are
top + right border
bottom + right
In CSS3 , thanks to all the new selectors available, you can take advan-
tage of those relationships directly with no need to add extra class attri-
butes. In this section, you'll learn about the key ways of selecting
elements with CSS combinators and pseudo-classes.
Selecting sets of elements with combinators
Combinators allow you to chain simple selectors together. They're the
workhorses of CSS . The following diagrams show a simple HTML
fragment as a tree structure and then highlight the elements that the
different rules select using the common CSS2 combinators.