开发者

Using both <link> and @import to import the same stylesheet?

开发者 https://www.devze.com 2023-02-11 05:30 出处:网络
Is it ever necessary or advisable to use both <link> tags and the @import command to import a stylesheet? In particular, I\'m looking at lines 14-15 of this page, where it appears both commands

Is it ever necessary or advisable to use both <link> tags and the @import command to import a stylesheet? In particular, I'm looking at lines 14-15 of this page, where it appears both commands are used to import the same stylesheet. Why did the author do this?

EDIT: For posterity, here's the code in question:

<link rel='stylesheet' type='text/css' media='all' href='http://socialmediaclassroom.com/index.php?css=site/site_css.v.1223354306' />
<style type='text/css' media='screen'>@import "http开发者_Python百科://socialmediaclassroom.com/index.php?css=site/site_css.v.1223354306";</style>


Here's why.
I must say that using the same css is a bit confusing.


I can't think of a single reason to do this:

<link rel='stylesheet' type='text/css' media='all' href='site_css.v.1223354306' />
<style type='text/css' media='screen'>@import "site_css.v.1223354306";</style>

In fact, it seems retarded. If there's some obscure reason to do this, someone please tell me :)

The author should get rid of the @import line, because it can cause slow downs in initial page rendering.

See here for why: don’t use @import, or the Yahoo recommendations document.

0

精彩评论

暂无评论...
验证码 换一张
取 消