Differences between the CSS of the imported style table and the CSS of The Link style table

Source: Internet
Author: User

 
Differences between the CSS of the imported style table and the CSS of The Link style table
Html code:
<Head>
<! -- Link external style: adds a <link> flag to the <Link href=”style.css "rel =" stylesheet "type =" text/css "/>
<! -- Import external style: import an external style table between the <style> </style> labels of the internal style table. @ import -->
<Style type = "text/css">
@ Import "CssStyle.css ";
</Style>
</Head>
The difference between the CSS of the imported style table and the CSS of The Link style table:
1. css linked by link is used when the client browses Your webpage, the external CSS file is first loaded into the webpage, and then compiled and displayed, in this case, the displayed webpage has the same effect as we expected, even if the network speed is slower. The CSS imported with @ import is different. When the client browses the webpage, it first presents the html structure and then loads the external CSS file into the webpage, of course, the final effect is the same as that of the former, but when the network speed is slow, the html webpage will first display the html webpage without CSS uniform layout, which will give readers a bad feeling. This is also the main reason why most websites currently use CSS links;


 
2. Import styles to avoid too many pages pointing to a css file. When there are not many pages using the same CSS file on the website, these two methods have almost no difference in effect, however, when the number of pages of a website reaches a certain level (such as Sina portal), the speed may decrease because multiple pages call the same CSS file, however, websites with pages that can reach this level will also have the best hard disks for capital use, so there is no need to worry about these factors.

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.