Help with the <head> tag!

Discussion in 'HTML & Website Design' started by mcfc4eva, Jun 15, 2010.

  1. #1
    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
     
    mcfc4eva, Jun 15, 2010 IP
  2. Ecfy

    Ecfy Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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 :p
     
    Ecfy, Jun 15, 2010 IP
  3. extremephp

    extremephp Peon

    Messages:
    1,290
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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 :D. 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.
     
    extremephp, Jun 15, 2010 IP
  4. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #4
    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.
     
    Cash Nebula, Jun 16, 2010 IP
  5. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Usually javascripts can move to the bottom of the page. Specially when the file is huge, it helps the page content render quicker.
     
    imperialDirectory, Jun 16, 2010 IP
  6. Ecfy

    Ecfy Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Oh so the order you put it is the order it will load? I guess I just learned something :D
     
    Ecfy, Jun 16, 2010 IP
  7. shahbazkhw

    shahbazkhw Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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.
     
    shahbazkhw, Jun 16, 2010 IP
  8. mahesh2011

    mahesh2011 Peon

    Messages:
    56
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    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....
     
    mahesh2011, Jun 16, 2010 IP
  9. otshare

    otshare Peon

    Messages:
    70
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    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>
     
    otshare, Jun 17, 2010 IP
  10. hes

    hes Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    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.
     
    hes, Jun 23, 2010 IP
  11. Skuvnar

    Skuvnar Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    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.
     
    Skuvnar, Jun 24, 2010 IP
  12. Skuvnar

    Skuvnar Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    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.
     
    Skuvnar, Jun 24, 2010 IP
  13. Airwalk Enterprise, Inc

    Airwalk Enterprise, Inc Peon

    Messages:
    126
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    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 :)
     
    Airwalk Enterprise, Inc, Jun 24, 2010 IP
  14. IRichie

    IRichie Peon

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    No particular order but I use Head, Title, Meta, Description, H1, Script and so on....
     
    IRichie, Jun 26, 2010 IP
  15. SampathW

    SampathW Guest

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    There is no particular order. But the important thing is that you open and close all the tags properly.
     
    SampathW, Jun 26, 2010 IP