CSS Basic concepts (basic CSS concepts) second, rule structure

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.