Three ways to refer to CSS styles

Source: Internet
Author: User
Tags tag name

CSS style

3 the advantages and differences of the type of reference:

    1. Externally introduced styles

Pros: Code is easy to manage and maintain, and a CSS can control multiple pages. Increase loading speed.

Disadvantage: When the external CSS is too large, it can cause the request pressure of the server.

    1. Head Introduction Style:

. The advantage: the fastest load, and does not cause the server pressure.

Disadvantage: It is not conducive to maintenance and revision, the code is a large amount of chaos.

    1. Inline style:

. Advantage: Highest priority.

Cons: Code chaos, not conducive to revision and maintenance, impact on development costs

Priority level:

Select one or more labels to operate

There are three commonly used selectors: Tag name selector, class name selector, id name selector. (In the name of the time should be as far as possible and the content of English;)

Tag name selector: Controls the style of a particular label;

Class name selector: Controls the style of one or more labels;

ID Selector: Controls the style of a defined label (used when loading the behavior in JS)

Priority:id> class name class> tag name

Three ways to refer to CSS styles

Related Article

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.