HTML& CSS - 把< link> < head>之外的标签 [英] HTML & CSS - put <link> tag outside of the <head>

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

问题描述

< link> 放到< head /> 标签,例如在页脚方面?

哪个不好而且结果很好?

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



谢谢

解决方案

样式表链接在 < head> ,以便浏览器可以对HTML进行样式设置并进行渲染。如果将样式信息放在文档的底部,浏览器将不得不重新进行重新设置,并将整个文档从顶部再次呈现出来。



首先,需要更长的时间,并且其次,看起来真的很难看。



这与所包含的脚本不同,因为脚本将阻止加载直到完成,因此您尽可能晚地加载它们。 p>

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?

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...

thanks

解决方案

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; &lt; head&gt;之外的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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