Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rocoeh 65 posts 86 karma points
    Mar 21, 2012 @ 10:17
    Rocoeh
    0

    setting base path or root path

    Hi,

    I am having an issue with my stylesheets.

    Using

    ~/css/style.css in master

    or /css/style.css in the children templates the css is not being picked up by the html page.

    I am from a Drupal (ahem!) background and usally on localhost I can set a $basepath global and then set my alias in MAMP or change my host file to give me a more pleasant url, like testsite.localhost.com.

    My current umbraco installation is setup on the the root folder so the site resolves to http://localhost and my page is on http://localhost/home.aspx.the css is on http://localhost/css/style.css and I can see my styles in the browser.

    Any help would be appreciated.

     

     

     

     

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Mar 21, 2012 @ 16:44
    Tim
    0

    Hiya,

    If you view the source of the pages, what is it saying the links to the CSS are? Are they stylesheet links correct, or are they linking to an incorrect URL?

    Umbraco should pick up it's base path automatically, but to use ~/ in a stylesheet or JS element in the head, I think you need to add runat="server" to your page's head tag, so it looks like:

    <head runat="server">
    [title, css and js links etc here]
    </head>

Please Sign in or register to post replies

Write your reply to:

Draft