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

itsme picture itsme · Aug 23, 2013 · Viewed 29.5k times · Source

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

Answer

user1864610 picture user1864610 · Aug 23, 2013

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.