1 link Common usage
<link rel="icon" href="xxx">
<link rel="stylesheet" href="xxx" />
Copy the code
2 @ import usage
@import url(xxx)
Copy the code
3 Common Differences
-
Link is used in HTML tags, usually in headers. Import is used in CSS files.
-
Load order: Link is loaded at the same time as the page is loaded, and @import is loaded after the page is loaded.
-
Compatibility problem: Link has no compatibility problem. @import Not supported by earlier versions of browsers