Copied to clipboard

Flag this post as spam?

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


  • Craig O'Mahony 364 posts 918 karma points
    Nov 26, 2012 @ 10:54
    Craig O'Mahony
    0

    Styling 'lost' in a live environment

    Hi Folks,

    I've started developing a site locally and I want to show the end user what it going to look like. So I've uploaded everything onto my web host but the css links aren't working.

    I've tried messing around with the directory path but I can't get them to show (although they all work on a local install). Has anybody seen this sort of thing before. The URL is badappledesign.co.uk/rsfleetcms

    Thanks in advance,

    Craig

  • Stephen Davidson 216 posts 392 karma points
    Nov 26, 2012 @ 16:24
    Stephen Davidson
    0

    The problem is this...

    <link href="../css/style.css" rel="stylesheet" type="text/css" />

    I would use the following for both local and remote and this would apply to all references, including your images. This will ensure everything works when you ahve sub level or evern sub sub level pages.

    <link href="/css/style.css" rel="stylesheet" type="text/css" />

    It could also be that the pages has been published without a template selected...

    Hope this helps,

    S

  • Craig O'Mahony 364 posts 918 karma points
    Nov 26, 2012 @ 16:41
    Craig O'Mahony
    0

    Hi Stephen,

    Originally the all the css links were in the format of <link href="/css/style.css" rel="stylesheet" type="text/css" /> 

    I changed it on the live site because I was trying to get the CSS to apply so I went from /css to css to ../css and none of them worked. I've changed back to /css but still the styling isn't being applied.  

    How'd you mean though that the page has been published without a template? In the Umbraco content node it says it has!

    Thanks,

    Craig

  • Stephen Davidson 216 posts 392 karma points
    Nov 26, 2012 @ 16:53
    Stephen Davidson
    0

    Usually when a CSS is not being referenced correctly then the page will still display but with no styling, kinda like plain text. When i visited your site is was a blank page.

    I'm pretty sure the CSS is bring refernece correclty, when you view source in CHrome I can click on the CSS links and it works, always  good sign. 

    http://badappledesign.co.uk/css/style.css

    Have you made sure the master pages/templates being used by the page itself has been copied up? It does not look to me like the images etc are there...

    http://badappledesign.co.uk/images/rslogo-white.png - This is reference in the code but it not on the site...

    well at least not at that URL...

    http://badappledesign.co.uk/rsfleetcms/images/search_bttn.png -  This works.

    Stephen

  • Stephen Davidson 216 posts 392 karma points
    Nov 26, 2012 @ 16:57
    Stephen Davidson
    0

    I think see the problem...your site is a subfolder of the main site...do you have control over the IIS?

    or you could try <link href="css/style.css" rel="stylesheet" type="text/css" />

    S

  • Craig O'Mahony 364 posts 918 karma points
    Nov 26, 2012 @ 17:01
    Craig O'Mahony
    0

    The page isn't blank (although it looks it) if you scroll down the page you'll see the, unformatted, text. 

    After looking at the source in chrome I can see that the css is looking in the wrong folder. Currently it's trying to find css/scripts/images on the root folder (badappledesign.co.uk/) and they don't exist there, where it should be looking in badappledesign.co.uk/rsfleetcms/.

    Think we've both sorts seen the problem! I don't have direct control over the IIS but I can make a request to the people that do. What should I be telling em?

    Thanks again!

    Craig

  • Stephen Davidson 216 posts 392 karma points
    Nov 26, 2012 @ 17:34
    Stephen Davidson
    0

    Did you try using 

     <link href="css/style.css" rel="stylesheet" type="text/css" />

    S

  • Craig O'Mahony 364 posts 918 karma points
    Nov 26, 2012 @ 17:53
    Craig O'Mahony
    0

    I did indeedy that again points to the root folder of the site. 

    As this site is heavily in development and when it's eventually put live it will exist in the root of the directory I might actually use /rsfleetcms/css for the link reference. 

    Thanks,

    Craig

  • Arie 224 posts 675 karma points
    Nov 27, 2012 @ 21:10
    Arie
    0

    Have you tried this?

    <link href="~/css/style.css" rel="stylesheet" type="text/css" />
  • Craig O'Mahony 364 posts 918 karma points
    Nov 28, 2012 @ 10:33
    Craig O'Mahony
    0

    Hi Arie,

    Yes I've tried that one....with no luck

  • Arie 224 posts 675 karma points
    Nov 28, 2012 @ 14:52
    Arie
    0

    Are you trying to run this site in a subfolder of the main site? If so, you'd run into problems as "/" would refer to the root of the main site - not the subfolder 'root'.

    Options:

    • Create a new site in IIS and point a dedicated subdomain to it (e.g. test.badappledesign.co.uk).
    • Use a subdomain that points to your main instance (badappledesign.co.uk). This option would some creative redirecting (IIS Redirector).
    • Add a tag to the HTML (http://www.w3schools.com/tags/tag_base.asp).
Please Sign in or register to post replies

Write your reply to:

Draft