CSS style
3 the advantages and differences of the type of reference:
- Externally introduced styles
Pros: Code is easy to manage and maintain, and a CSS can control multiple pages. Increase loading speed.
Disadvantage: When the external CSS is too large, it can cause the request pressure of the server.
- Head Introduction Style:
. The advantage: the fastest load, and does not cause the server pressure.
Disadvantage: It is not conducive to maintenance and revision, the code is a large amount of chaos.
- Inline style:
. Advantage: Highest priority.
Cons: Code chaos, not conducive to revision and maintenance, impact on development costs
Priority level:
Select one or more labels to operate
There are three commonly used selectors: Tag name selector, class name selector, id name selector. (In the name of the time should be as far as possible and the content of English;)
Tag name selector: Controls the style of a particular label;
Class name selector: Controls the style of one or more labels;
ID Selector: Controls the style of a defined label (used when loading the behavior in JS)
Priority:id> class name class> tag name
Three ways to refer to CSS styles