Home  >  Article  >  Web Front-end  >  css priority issue

css priority issue

WBOY
WBOYOriginal
2016-11-30 23:59:371551browse

About CSS specificity
The specificity characteristic of CSS, or extraordinaryness, is a standard that measures the priority of CSS values. Since it is a standard, it has a set of relevant determination regulations and calculation methods. Specificity uses a four-digit number. It is represented by a string (CSS2 is three digits), which is more like four levels. The values ​​are from left to right, with the left being the largest. One level is greater than one level. There is no base between the digits, and the levels cannot be surpassed.
When multiple selectors are applied to the same element, the one with the highest Specificity value will eventually get priority.
Selector Specificity value list:
Rules:
1. The inline style priority Specificity value is 1,0,0,0, which is higher than external definition.
For example:

sjweb

External definition refers to the rules defined through the or