HTML &amp;CSS - 放置 &lt;link&gt;<head> 之外的标签 [英] HTML &amp; CSS - put &lt;link&gt; tag outside of the &lt;head&gt;

查看:23
本文介绍了HTML &amp;CSS - 放置 &lt;link&gt;<head> 之外的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将 放在 标签之外的 css 文件中,例如在页脚一侧?

Is it ok to put the <link> to a css file out of the <head/> tag, for example in the footer side?

这有哪些好的和坏的结果?

Which are bad and good results of this?

我问这个,因为实际上我有一个 css 文件,它没有任何样式,只是给我的网站带来了一些 css3 动画,所以我想把它放在 html 的末尾,只是出于性能原因......

I ask this, cause actually i have a css file which doesn't styles anything but brings just some css3 animations to my website, so i would like to put it to the end of the html just for performance reason...

谢谢

推荐答案

样式表链接在 <head> 中,以便浏览器可以设置 HTML 样式并随其呈现.如果您将样式信息放在文档底部,浏览器将不得不重新设置样式并再次从顶部渲染整个文档.

Style sheets are linked in the <head> so that the browser can style the HTML and render it as it goes. If you put the style information at the bottom of the document the browser will have to restyle and render the whole document from the top again.

这首先,需要更长的时间,其次,看起来真的很丑.

This firstly, takes longer, and secondly, looks really ugly.

这与包含的脚本不同,因为脚本会在加载完成之前阻止加载,因此您在此过程中尽可能晚地加载它们.

This differs from included scripts as scripts will block loading until they are done, so you load them as late as possible in the process.

这篇关于HTML &amp;CSS - 放置 &lt;link&gt;<head> 之外的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆