Five methods to introduce CSS Styles 1. Use STYLE attributes
Add the STYLE property directly to the tags of individual components, <元件(标签) style="性质(属性)1: 设定值1; 性质(属性)2: 设定值2; ...}
例如:
The advantage of this usage is that the style can be applied to various labels smartly, but the disadvantage is that there is no "uniformity" of the entire file 』.
Ii. Use STYLE labels
Write style rules inTag.
For example:
Generally, the entireStructure written on the webpage . The advantage of this usage is the uniformity of the entire file. As long as there is a declared component, this style rule will be applied. The disadvantage is that the flexibility of individual components is insufficient.
3. Use LINK labels
Write the style rules in the. CSS style file, and then use Label introduction.
Assume that we save the sample rules into an example.css file. We only need to add
You can apply the style specified in the style file. The LINK tag is usually written on a webpage.. The advantage of this method is that you can specify the same style file for all the files that apply the same style rules. The disadvantage is that the flexibility of individual files or components is insufficient.
4. Use @ import to introduce
It is similar to LINK usage, but it must be placed in.
For example:
Note that the semicolon at the end of the line is absolutely indispensable!
5. Use tags to introduce styles
For example, WEB standards