This section describes the CSS application. Of course, we should first introduce how to create a Style sheet, including the declaration method and the method applied on the webpage, in the end, we will give you an overview of some CSS features. In summary, there are three methods to declare CSS:
I. Basic Declaration: The most typical CSS declaration method.
If element {property: value} is expressed in Chinese, that is
Component (tag) {property name: set value}
For example:
H3 {COLOR: BLUE} is a set of declarations.
II. Collective declaration: a group or array style rule (nature) that declares one or more components (tags) separated by commas) (rules of each group are separated by semicolons ).
Component (label ){
Property Name 1: Set to 1;
Property Name 2: Set to 2;
...}
Or
Component A (label A), Component B (label B), Component C (label C ),...{
Property Name 1: Set value 1;
Property Name 2: Set to 2;
...}
For example:
TD {
COLOR: BLUE;
Font-size: 9pt;
}
Or
TD, P, DIV {
COLOR: BLUE;
Font-size: 9pt;
}
III. Sub-item declaration: Group and declare multiple style rules separately.
Component A (label A) {property name 1: Set value 1; property name 2: Set value 2 ;}
Component A (label A) {property name 3: Set value 3; property name 4: set value 4 ;}
For example:
TD {COLOR: BLUE; font-size: 9pt}
TD {font-family: ""; line-height: 150%} does not conflict with each other because the declared nature is different. If you accidentally make repeated declarations for the same nature, only the set values that will be declared later will function.
Note that, in your declaration, your format will be accepted as long as it is correct, and the display results will not be affected whether it is case sensitive, blank, or line feed, you can write it according to your habits.
Method of application of C S
Next, we will introduce four basic methods for applying the created style sheet to the webpage.
1. Use the STYLE attribute: add the STYLE attribute to individual component labels.
<Component (label) STYLE = "property (attribute) 1: Set value 1; property (attribute) 2: Set value 2 ;...}
For example:
<Td style = "COLOR: BLUE; font-size: 9pt; font-family:" "; line-height: 150%> 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 』.