CSS Stacking order

Source: Internet
Author: User

CSS cascading rules and the specificity of each selector.

1, there! The important rules have a higher weight than none, and the rules with!important have the highest precedence.

2, according to the specific order of the rules, the particularity of each selector is:

The specificity of inline styles (that is, CSS declared in HTML) is: 1000

The specificity of the ID selector is: 100

Class attribute value (Class), Pseudo-Class (: not), property selector ([id= "]) is special: 10

Individual elements and pseudo-elements (: First-letter,first-line,before,after) are: 1

The particularity of a wildcard selector (*) is: 0

3, if the specificity is equal, according to the order of occurrence, after the rules appear in the first rule covered.

CSS Stacking order

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.