Search code examples
cssstylesheet

Style sheets priority order


If I have the following style sheets:

user important declarations
user normal declarations
author normal declarations
user agent declarations
author important declarations

and need to apply them from highest priority to lowest priority, in which order should I use them?


Solution

  • The correct order of precedence is, from least important to most important:

    1. User Agent
    2. User Normal
    3. Author Normal
    4. Author Important
    5. User Important

    As defined in the specification