The difference between CSS-linked and imported

Source: Internet
Author: User
LINK Type:

<link href= "Style.css" rel= "stylesheet" type= "Text/css"/>

Import Type:

<style type= "Text/css" >   @import "style.css";  </style>

Difference: When you use link mode, the CSS file is loaded before the body portion of the page is loaded, so that the displayed page is styled from the beginning
Import, will be loaded in the entire page after loading the CSS file, for some browsers, in some cases, if the size of the Web page file is larger, you will see the first display no style page, after a flash after the setting style after the effect.

For the larger web site, for ease of maintenance, you may want to put all CSS styles into several CSS files, so if you use the introduction of links, you need to import a few statements to CSS, if you want to adjust the CSS file classification, you need to adjust the HTML file. This is a flaw in maintenance work. If you use an import, you can introduce only one total CSS file, and then import other standalone CSS files in this file, and the link does not have this feature



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.