Hi guys, Just a quick, relatively simple question about the HTML <head> tag. As we all know, tags such as <base>, <link>, <meta>, <script>, <style>, and <title> go inside the <head> tag. My question is; Do they have to follow any particular order? Thanks, Michael
I don't think they do have to follow a particular order, but I might be wrong, as I just started learning that kind of stuff
Things Load According to the Order they are listed up.. Imagine You have a heavy website which takes 1 min to load, And your title tag is just above the HTML close tag or in that area... Your title will be seen only after 1 Min then . i.e after your site is loaded. And Some people makes mistake in loading CSS.. that should be done at first or else, page loads, and then Flickers to the exact style.. i.e only then the style is loaded. I hope you got it solved. Thanks.
There is no order to the elements in the head section. Some scripts can be moved to the bottom of the body section to make the content load faster.
Usually javascripts can move to the bottom of the page. Specially when the file is huge, it helps the page content render quicker.
I suggest you let the css load first and the java after that, since the css will probably be defining how your page layout is supposed to be like. The title tag needs to go above everything else, and can be followed by the meta tags and descriptions.
every thing has an order in life.....the format should be followed in order to maintain the website properly and it should interact the users in a first view itself ....all proffesionals follow the order ...if the order is misplaced ..the loading of the page will be slower....
I think it is true that the tags are rendered on the browser in the order they appear in the html page. So I always try to follow the following sequence: <head> <meta> <title> <css> <link> <script>
Same here. I have scripts in the header to load other libraries like jQuery and variables and scripts at the end of the page ensuring all elements are loaded before javascript executes any actions on the elements.
no ordering is really necessary, since HTML is not programmable and that stuff in the head isn't rendered so I think ordering does not really matter.
Also just a quick note, if you are going to try to improve your site's performance, ordering is somewhat of a matter, particularly if you are dealing with CSS links and javascript code. Generally CSS should go at the top of the page and Javascript at the bottom - this is mainly due to the browser allowing parallel downloads of CSS whilst javascript it doesn't.
It is rumoured that meta tags and title should be at the top of your html page. It's not a sure thing, but it couldn't hurt
There is no particular order. But the important thing is that you open and close all the tags properly.