CSS Reference styles

Source: Internet
Author: User
Llink and @import The difference between the introduction of external styles and affiliation

Link is an HTML tag, and @import is completely a way to provide CSS.

• Limit of @import times

@import can only introduce 31 times CSS files.

• Different loading order

When the page is loaded, the CSS referenced by the link is loaded at the same time, and the CSS referenced by @import waits until the page is fully downloaded and then loaded. So sometimes browsing @import loading CSS page when there is no style, and then suddenly the style will appear, the speed of the slow time is quite obvious.

• Differences in compatibility

Since @import is proposed by CSS2.1, @import can be identified only in the IE5 above, and the link tag does not have this problem

• Differences when using DOM to control styles

When using JavaScript to control the DOM (document.stylesheets) To change styles, you can only use the link tag, because @import is not controlled by the DOM.

CSS Reference styles

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.