What is the difference between link and @import in CSS?
Both load an external CSS file, but in different ways.
| Point | <link> | @import |
|---|---|---|
| Where | In the HTML head | At the top of a CSS file |
| Loading | In parallel with the page | After the CSS file that has it is read, so slower |
| Use | Best choice | Avoid for performance |
<link rel="stylesheet" href="style.css">
@import url("other.css");
See CSS Inclusion.
Learn more about the similar topics:
| Tutorials |
|---|
| CSS Introduction |
| CSS Inclusion |
| CSS Syntax |
| CSS Comments |
| CSS Variables |
| List of common CSS Properties |
| Exercises & Assignments |
|---|
| No Content Found. |