Style sheets priority order

前端 未结 3 932
南旧
南旧 2020-12-10 00:57

If I have the following style sheets:

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


        
3条回答
  •  猫巷女王i
    2020-12-10 01:16

    CSS declarations are applied in this order (from lowest to highest priority):

    1. user agent declarations (the default styles your browser applies to elements)
    2. user normal declarations (a user's own stylesheet if they're using one)
    3. author normal declarations (this is your normal stylesheet)
    4. author important declarations (anything your mark important)
    5. user important declarations (any important styles from the user's stylesheet)

提交回复
热议问题