How browsers load and parse css--css style sources and cascading rules

Source: Internet
Author: User

About CSS Styles first understand how the browser loads them, and how the final page style is rendered?

The key to CSS cascading style sheets is "cascading", which overlays or overrides styles from one another based on the use of selectors.

CSS stylesheets have a "cascade" concept, because there are multiple style sources, different style settings source different weights,

Order of Precedence: 1 to 5 weights reduced in turn

1

html style inside the label header               (not recommended, structural style separation)
2

<style> style code         (for pages that are infrequently updated or rarely accessed)
3

<l Ink> referenced CSS file              (recommended use, easy maintenance, reasonable development)
4

user-defined browser style

5

browser default Style /td>

Overlay : The browser will overlay the styles of all sources together, merging the scattered pieces into a single whole .

Overwrite : If multiple source styles have the same style, depending on the weight value, the high-weight style overrides the low-weight style -Special case: With! Important decorated styles have the highest weight.

How browsers load and parse css--css style sources and cascading rules

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.