CSS-CSS Authoritative Guide Study notes 3

Source: Internet
Author: User

Chapter III Structure and CASCADE

1. When determining which values should be applied to an element, the user agent not only takes into account the inheritance, but also considers the specificity of the declaration, and also the origin of the declaration itself, which is called Cascading. 、

2, Particularity. If an element has two or more conflicting attribute declarations, the Highest-specificity declaration wins.

For the value of the attribute of each ID given in the selector, add 0,1,0,0;

Generic type, attribute selection or pseudo-class, plus 0,0,1,0; (the attribute selector for the specified ID attribute still contributes 0010)

For elements and pseudo-elements, add 0,0,0,1;

The binding character and the wildcard selector do not contribute to the Particularity. (the Wildcard has no contribution to the particularity and at all no particulars have differences.) )

Inline style particularity 1,0,0,0

Note that 0,0,1,0 is more special than 0,0,0,13.

3,! Important important statements are grouped together, and conflicts are resolved within important statements. In conflict with Non-important statements, important statements always win.

Cond

CSS-CSS Authoritative Guide Study notes 3

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.