Cascading Order
While using multiple style sheets you need to arrange these sheets in a well define order. The following characteristics will determine the outcome of CSS:
! important
A style that is designated as important will win out over contradictory styles of otherwise equal weight.
Selector Rules
It is a counting game to calculate the specificity of a selector.
- Counting the number of HTML tag names in the selector.
- Counting the number of ID attributes in the selector.
- Counting the number of CLASS attributes in the selector.
Order of Specification
If two rules are the equal weight, the last specified rule wins.
CSS Grouping
CSS grouping allows you to minimize the code. For this
more...