Brother Lian Learning python----several common selectors in CSS

Source: Internet
Author: User

CSS selectors commonly used selectors are as follows: 1, Tag Selector tag Selector, this kind of selector has a large scope of influence, it is recommended to apply in the hierarchy selector as far as possible. Example: *{margin:0;padding:0}div{color:red} <div>....</div> <!--corresponds to the above two styles--><div class= "box" > ....</div> <!--corresponds to the above two style-->2, the ID selector selects the element by the ID name, the element's ID name cannot be duplicated, so a style setting item can only correspond to the previous element of the page, cannot be reused, and the ID name is generally used by the program. It is therefore not recommended to use the ID as a selector. Example: #box {color:red} <div id= "box" >....</div> <!--corresponds to one of the above styles, other elements are not allowed to apply this style-->3, the class selector selects the element through the class name, A class can be applied to multiple elements, one element can use more than one class, the application is flexible, reusable, is the most applied in the CSS of a selector. Example:. red{color:red}.big{font-size:20px}.mt10{margin-top:10px} <div class= "Red" >....</div>

  

Brother Lian Learning python----several common selectors in CSS

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.