CSS Learning Note 4

Source: Internet
Author: User
  • A pseudo-class can be used to specify one or more states of its associated selectors, such as A:link a:active a:hover a:visited; IE7 and below are not supported.
  • A pseudo-object is extra information that creates a document in addition to the information specified in the HTML document. such as p:before{content: "..."}

  • The label for the parent style is not inherited: H1~h6. Mastering the inheritance of selectors, the flexible use will bring a lot of convenience to write CSS code later, save the development time, save the CSS code. Therefore, before writing CSS, the usual thing to do is to use the inheritance of CSS to the overall planning of the page, detailed analysis, with good CSS code to achieve the layout and style of the page.
  • Why are the attributes declared by the!important keyword the highest priority in the style? A: To give the user more control over the style, you can set the!important keyword declaration on the property to increase the weight of the attribute. But it must be used with caution!!!
  • CSS takes precedence in the order
    1. Attributes declared by the!important keyword
    2. CSS style properties in HTML
    3. Author-edited CSS file style properties
    4. User-Set style
    5. Browser Default Style
  • Priority points:
    1. Tag selectors, pseudo-classes, and pseudo-objects: 1
    2. Class Selector, property selector: 10
    3. ID Selector: 100
    4. Style properties: 1000
    5. Other, such as *:0

CSS Learning Note 4

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.