About CSS Styles first understand how the browser loads them, and how the final page style is rendered?
The key to CSS cascading style sheets is "cascading", which overlays or overrides styles from one another based on the use of selectors.
CSS stylesheets have a "cascade" concept, because there are multiple style sources, different style settings source different weights,
Order of Precedence: 1 to 5 weights reduced in turn
| 1 |
html style inside the label header (not recommended, structural style separation) |
| 2 |
<style> style code (for pages that are infrequently updated or rarely accessed) |
| 3 |
<l Ink> referenced CSS file (recommended use, easy maintenance, reasonable development) |
| 4 |
user-defined browser style |
| 5 |
browser default Style /td> |
Overlay : The browser will overlay the styles of all sources together, merging the scattered pieces into a single whole .
Overwrite : If multiple source styles have the same style, depending on the weight value, the high-weight style overrides the low-weight style -Special case: With! Important decorated styles have the highest weight.
How browsers load and parse css--css style sources and cascading rules