CSS: Final tips: Watch your changes

  1. More about precedence
  2. Final tips
  3. Good design helps

Be careful, when making changes, that you are not relying on some settings that are not CSS dependent. For example, when setting a foreground or background color, you should also set the other. Otherwise you run the risk that the user has a foreground color that matches your background color, or vice-versa.

Another example is setting block text to some character-level formatting. If you make blockquotes italic, for example, what happens to emphasized text inside the blockquote? It will also be italic, rendering it indistinguishable from the blockquoted text. If that’s a problem, you should fix it. For example:

blockquote {

font-style: italic;

}

blockquote em {

font-style: normal;

}

This turns any emphasized text inside of a blockquote to normal instead of italic. Since it also sets blockquoted text to italic, the emphasized text once again stands out.

  1. More about precedence
  2. Final tips
  3. Good design helps