Selectors 395
CSS
Selectors
Web Design in a Nutshell, eMatter Edition
set of rules for resolving conflicts between different style sheets. Styles with more
weight (those defined at the more specific level) will take precedence over styles
set in a higher-level style sheet.
As in inheritance, more specific rules override more general rules. This allows you
to design a general style for a whole site, then modify it for particular pages or
elements, alleviating redundancy.
The following list shows the hierarchy of style instructions from general to specific,
such that elements lower in the list have more weight and will override styles
above them.
- Browser default settings
- User style settings (set in browser)
- Linked external style sheet
- Imported style sheets; when multiple styles are imported, the commands from
the last file read will take precedence over the first ones listed - Embedded style sheets (rules within the