Support » Themes and Templates » CSS working differently in local theme and online theme

  • The details are too long to go into in full (and I’m much too tired) but I thought I’d ask whether this kind of thing has happened to anyone.

    I’m working on a WP theme on a local server, then uploading it to see it online. Basically every single file on the local version and the online version is exactly the same. I even have the same couple of dummy posts and the same links and stuff in the sidebar. Everything should look identical.

    At the bottom of my template I have a div with a CSS background image which acts as the footer image. Just before that, a list of links, absolutely positioned which end up at the top of the page in the layout. The details are not important – what’s important is that it worked fine on the local version, but the background image of the footer wouldn’t show in the online version.

    After 2 hours of near insanity, I switched the order of the two elements. Voila, now it works in both.

    Forgetting about specifics, what’s really worrying me is that something in the template worked perfectly on the local installation of WP, but screwed up in the online version, even though all relevant files are identical. Has anyone else ever experienced this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Relative URL’s work fine in local installations. When you load everything onto a remote server, it is sometimes necessary to use absolute URL’s for things like images, scripts, etc. This is a fairly common problem.

    I understand that, but the thing that fixed my problem was simply changing the order of two elements in the index.php template. The order of them made no difference in the local installation but a big difference on the server.

    What really got to me was that just after writing that post, my main background image, which was styling the main “html” tag, suddenly stopped working for no reason online. I moved it to the “body” tag and it worked fine. It’s still working fine in the html tag locally. Everything is identical in the two templates and the css, I’m simply uploading from the local installation. I guess I should just forget about it since everything is now OK, but there will always be that nagging doubt in the back of my mind, you know how it is!

    you should get firebug (firefox addons) its good for debugging live website.
    my 2¢

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘CSS working differently in local theme and online theme’ is closed to new replies.