Link type:
<link href="style.css" rel="stylesheet" type="text/css"/>
Import type:
<style type="text/css"> @import"style.css"; </style>
Difference: When using the link method, the css file will be loaded before loading the main part of the page, so that the displayed web page will have styles from the beginning
Load the css file after the page is loaded. For some browsers, in some cases, if the web page file is relatively large, the unstyled page will be displayed first, and then the styled effect will appear after a flash.
For larger websites, in order to facilitate maintenance, you may want to classify all css styles into several css files. In this way, if you use link import, you need several statements to import css separately. If you want to adjust the css When classifying files, you need to adjust the HTML files as well. This is a drawback for maintenance work. If you use the import type, you can only import a general css file, and then import other independent css files in this file; links do not have this feature
More css link type and import type For articles related to differences, please pay attention to the PHP Chinese website!