Multiple CSS styles are stacked into one

Source: Internet
Author: User

From: w3school.com.cn

Multiple styles are stacked into one

Style sheets allow you to specify style information in multiple ways. Styles can be specified in a single HTML element, in the header element of an HTML page, or in an external CSS file. You can even reference multiple external style sheets in the same HTML document.

Cascade order

Which style will be used when the same HTML element is defined by more than one style?

Generally, all styles are stacked in a new virtual style table according to the following rules, where number 4 has the highest priority.

  1. Browser default settings
  2. External style sheet
  3. Internal style sheet (inside the
  4. Inline style (inside the HTML element)

Therefore, inline styles (inside an HTML element) have the highest priority, which means they take precedence over the following style Declaration:

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.