Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Site looks perfect from localhost, but not from server [closed]

Tags:

html

css

apache

I'm stumbled upon very strange problem, I'm building a HTML mockup, it works well in all major browsers from localhost, but when I've uploaded it to server things went strange.

When I load my site from server in Chrome or Safari, header (which looks as I need it to from localhost) is displayed with distortions. But there is a chance when I reload page that it will be displayed normally.

Code from both locations are identical. Server is running with the apache 2.2.16

like image 884
user1327 Avatar asked Sep 07 '12 17:09

user1327


3 Answers

It is coming from a CSS which is injected from Adblock Plus Add-On. Deactivating the Add-On fixes the problem in Chrome with me.

This is injected from Adblock Plus right after the closing </body>:

<link rel="stylesheet" type="text/css" href="data:text/css,">
like image 167
Fabian Barney Avatar answered Oct 19 '22 23:10

Fabian Barney


I think I found the culprit (it now works every time on my local apacheserver):

.headblock {
    float: right;
    width: 650px;
}

(I removed height: auto;)

I also found a post about height: auto issues in Chrome, http://productforums.google.com/forum/#!topic/chrome/ikmnUr22cyI. And there has been no feedback there about it being fixed.

That wasn't it. I simplified the page and uploaded a fiddle, http://jsfiddle.net/KqVJ9/ for testing.

FIXED?

This updated version of it, http://jsfiddle.net/KqVJ9/3/, works for me constantly. It might not be exactly the same with padding/margin as the original but those tweaks I leave to you to fix. :)

like image 32
Henrik Ammer Avatar answered Oct 20 '22 01:10

Henrik Ammer


Your test server looks fine to me.

Two things (independent of Apache) spring to mind, though:

  1. Have you considered browser caching? When you update the CSS file, sometimes the browser will instead use an older, cached version of the file. See this question for tips on this.
  2. File and folder permissions. When uploading to web servers, often the permissions will get overwritten on each upload, and a dependent file (e.g. a CSS or javascript file) will not be accessible from the running Apache process.

    I run chmod -R 755 /path/to/my/webfolder/ quite often...

If this still doesn't work, I'd have a look at the Apache.conf files, to see if there any differences between the localhost and public servers. Can't think what it would be though... Permission differences maybe...

like image 40
Alex Leach Avatar answered Oct 20 '22 01:10

Alex Leach