Style sheet Precedence Order

Source: Internet
Author: User

1 The highest priority position is the <style> element of the header of the HTML document.

2 The location of the second priority is the style sheet imported by the @import statement in the <style> element.

3 The position of the third priority is the style sheet attached to the <link> element

4 Fourth priority position is the style sheet imported by the @import statement in the <link> element attached style sheet

5 5th Priority location is the end-user-attached style sheet

One exception is the!important rule in the end-user style sheet, which has the highest precedence. This allows the user to create rules that override the competition rules in the initial style sheet

6The last one is the default style sheet provided by the browser ~

If more than one style sheet is attached or imported at the same location level, their precedence is determined by the additional order, and the appended style sheet overrides the previously attached style sheet.

If the competition rules belong to the same selector group, have the same number and rank selectors, and have the same position level, then the rule in the code will overwrite the previous rule.

Style sheet Precedence 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.