Choosing the right set of rules
As you have figured out by now, there are multiple ways of accomplishing the same task, some better and some worse.
The best way for you to get an understanding about the choices is to try a big example for yourself. We'll build it up in stages, considering styling of lists, headers, and text.
For each kind of element, ask yourself a series of questions to figure out how best to choose rules. Here are the questions you could ask about headers; similar questions are appropriate for lists and other elements.
- Which style aspects are used for all headers?
- Which style aspects differ among different kinds of headers?
- Are there similarities among headers that can be described using various kinds of selectors, such as child or descendant selectors, sibling selectors, or attribute selectors?
- Does a class or ID need to be added to select certain headers?
- Does a containing element need to be added to group certain headers?
- Among the choices of selectors to use, which one has the selectivity you need?
