加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 最好使用链接标签或样式标签来导入CSS?

发布时间:2020-12-14 21:25:08 所属栏目:资源 来源:网络整理
导读:还是只是一个个人偏好的东西?我得到的是,使用这两种方法有什么具体的好处吗? link href="main.css" rel="stylesheet" type="text/css" 与 style type="text/css"@import url('main.css');/style 解决方法 根据雅虎的 Best Practices for Speeding Up Your
还是只是一个个人偏好的东西?我得到的是,使用这两种方法有什么具体的好处吗?
<link href="main.css" rel="stylesheet" type="text/css">

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

解决方法

根据雅虎的 Best Practices for Speeding Up Your Web Site,总是使用< link>而不是@import。更多详细信息,请参阅 this blog post。

In IE (tested on 6,7,and 8),@import
causes the stylesheets to be
downloaded sequentially. Downloading
resources in parallel is key to a
faster page. This behavior in IE
causes the page to take a longer time
to finish.

使用< link>允许浏览器打开其他连接,从而减少加载时间。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读