Leroy Mikenzi
Leroy Mikenzi

Reputation: 810

how is at the rate import filename.css in style tag different from link tag to relate to css file

how is at the rate import filename.css in style tag different from link tag to relate to css file.? I'm confused and they both do the same thing of giving css file path. I'm using this

<style>
@import "filename.css";
</style>

Upvotes: 0

Views: 122

Answers (2)

sandeep
sandeep

Reputation: 92793

Never use @import for stylesheet because it's block parallel download which effect the page performance.

Always use <link rel="stylesheet" href="stylesheet.css" > for stylesheet.

Upvotes: 0

Sanket
Sanket

Reputation: 393

- Linking is the first method for including an external style sheet on your Web pages. It is intended to link together your Web page with your style sheet. It is added to the of your HTML document like this:

@import - Importing allows you to import one style sheet into another. This is slightly different than the link scenario, because you can import style sheets inside a linked style sheet. But if you include an @import in the head of your HTML document, it is written:

@import url("styles.css");

more info : http://webdesign.about.com/od/beginningcss/f/css_import_link.htm

Upvotes: 2

Related Questions