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...
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:
For HTML 4.01: http://www.w3.org/TR/html401/struct/links.html#edef-LINK
If you put a <link> tag within the body of the HTML document, it will not validate using validate.w3.org