HTML & CSS - put <link> tag outside of the <head>

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

Answers


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.


According to the W3 specs, <link> tags are only supposed to go in the <head> section:

References

For HTML 4.01: http://www.w3.org/TR/html401/struct/links.html#edef-LINK

For HTML5: http://www.w3.org/TR/html5/document-metadata.html#the-link-element

Validation Issues

If you put a <link> tag within the body of the HTML document, it will not validate using validate.w3.org


Need Your Help

How to impose LIMIT on sub-query of JPA query?

jpa subquery jpql

Is it possible to impose LIMIT on sub-query in JPA query ?

Exclude label text from border

c# wpf label border

I've got a silver border with text on top that I would like to exclude(cut text away from the border) to see through to the background behind the border, that has a dropshadow bitmapeffect applied....

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.