Difference between @import and link

Disable text selection

Using both @import and link tag you can include style sheet in a webpage. But there is a difference.

For performance “link” has a much better advantage.

Example of @import and link:

<link href="style.css" type="text/css" />

<style type="text/css">
@import url("style.css");
</style>

As @import allows you to import one style sheet into another but older browsers didn’t recognize @import so for old browser it is better to use <link>.

You may like:  CSS3 required styles

Leave a Reply

Your email address will not be published. Required fields are marked *