The difference between an imported style sheet CSS and a linked style sheet CSS

Source: Internet
Author: User
<span style= "font-family:arial;" ><!--Link External styles: that is, add a <link> tag between the 

' Cause I don't know what to do, but I'll take a little time.


First, let's distinguish between what is linked to an external style and the import of external styles:

We know that the two ways of referencing external styles are almost the same, that is to refer to a separate CSS style file to a Web page file, but there are some subtle differences (because the design will not be bored to make two exactly the same thing), the following is based on my understanding of the two aspects of the discussion:

1, the use of link links to the CSS is the client to browse your Web page when the external CSS files loaded into the Web page, and then compile the display, so this situation shows the Web page as we expected the effect, even if the speed is slow is the same effect. And the use of @import imported CSS is different, the client when browsing the Web page is the HTML structure to present, and then the external CSS files loaded into the Web page, of course, the final effect is the same as the former, Only when the network speed is slow to show the first display without CSS unified layout of the HTML page, this will give the reader a bad feeling. This is also the majority of the Web site's CSS are the most important reason to use the link way;

2, import style can avoid too many pages point to a CSS file. When the Web site uses the same CSS file page is not very long, the two ways in terms of effect is almost no different, but the number of pages of the site to a certain extent (such as Sina, etc.), if the use of links may be caused by multiple pages call the same CSS file resulting in slow speed, But the General page can reach this level of the site will also have the capital with the best hard drive, so this aspect of the factors do not have to worry about.

Combining the above two factors, we can find that most of the sites now prefer to use links to refer to external CSS.


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.