II. rules structure (rule structure)
A rule is the basis on which a style is applied to a document. Each rule is made up of multiple components and has a specific name and functionality. As shown in. The selector is the part that determines which part of the document is to be matched by the rule. The style of the rule is applied to the selected element. For example, selecting the pre means that all pre elements will be selected. On a single rule, you can combine multiple selectors by separating the selector names with commas. See Chapter 2 for details that can be used with various selectors. the declaration block is bounded by a pair of curly braces. The selector is always on the left side of the declaration block (that is, the selector precedes the block). Whitespace in a declaration block is ignored, so you can use any number of spaces to make your code more readable. There are 0 or more declarations in the declaration block. Each declaration consists of a property followed by a colon, and the property value is followed by a semicolon. Property values will consist of one or more keywords and value types, usually (but not always) separated by a single space. the allowed properties and their possible values are discussed in chapters 4th through 6. There is only one attribute in each declaration. allows the declaration block to be null, in which case the element that the selector matches will not apply to this rule. This is functionally equivalent to not writing rules. CSS does not need to write a semicolon after the last declaration of a block, but some early CSS1 will mistakenly deny that the final declaration of any declaration block is not terminated with a semicolon.
CSS Basic concepts (basic CSS concepts) second, rule structure