What are the import methods in HTML? Answer: Link and @import

Link introduction:

Import @import

Development:

The difference between link and @import

1. The content of introduction is different

Link can import external files, such as images, in addition to style files, whereas @import can only import style files.

2. Different loading sequences

When link introduces CSS, it loads at the same time the page loads. @import is loaded only after all pages are loaded.

3. Compatibility is different

Link is an XHTML tag, no compatibility questions; @import is implemented in css2.1. It is not supported by earlier browsers and cannot be used normally.

4. Different support for JavaScript

Link supports using JavaScript to control DOM manipulation to change styles; @import not supported;