We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8461
    • 205 Posts
    Quick question

    Is it better to place
    <base href="[(site_url)]" />
    before or after the links to css files etc or does it really make no difference. my gut feeling would be before but welcome feedback

    <link rel="stylesheet" href="[(base_url)]assets/templates/site/nostyle.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="[(base_url)]assets/templates/site/main.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="[(base_url)]assets/templates/site/print.css" type="text/css" media="print" />
    <base href="[(site_url)]" />
      • 21496
      • 225 Posts
      The W3C states:

      When present, the BASE element must appear in the HEAD section of an HTML document, before any element that refers to an external source. The path information specified by the BASE element only affects URIs in the document where the element appears.

      Source: http://www.w3.org/TR/html401/struct/links.html#h-12.4

      Personally I place it before the links to the css files, as I tend to structure things hierarchically. But it seems to work fine when placed afterwards anyway.
        René