CSS basic learning notes

Source: Internet
Author: User

CSS selector:

1. Tag selector: set the same CSS format for all HTML tags.

2. Category selector: for example. class {color: green; font-size: 20px} class is the class name, color and font-size are the attributes, and green and 20px are the values corresponding to the attributes.

3. ID selector: used for a special tag on a page. For example, # ID {color: green; font-size: 20px}

4. collective declaration of selectors: selectors of different categories use the same CSS style.

5. nesting Declaration of the CSS selector: for example, p B {color: green} specifies a style for HTML <p> <B> </B> </P> to the content marked with B.

6. CSS sub-selector: ul. mylist> LI> A {color: Green} <body>

  • only this tag is valid

  • This a tag does not have CSS styles
  • <UI/>

    </Body>

     

    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.