21

Seems like Google Chrome is not displaying my site according to the stylesheet.

When the page first load, it loads fine...but then it changes to raw html format towards the end of the page load.

It ends up looking like this (you can see web address at the top bar):

[click for full size]

enter image description here

I have 2 style sheets, one is an "alternative" that a user can switch between by clicking the Light/Dark buttons at top right of the site.

Why is this happening? I never had a problem before.

My specs: Mac OS X with Google Chrome 14.0.835.186

GreatestSwordsman
  • 1,175
  • 5
  • 20
  • 39
  • 11
    For what it's worth, it is total BS that this question is closed for being too localized. This is a problem that affects users across multiple Chrome versions and operating systems. Anyway, it is most probably HTTPS Everywhere that is causing this issue, as one answer below states. – 0xff0000 Nov 21 '12 at 01:14
  • I agree that this should be re-opened. I had the same problem, which is why I was able to answer it. It affected me when viewing XKCD with ABP + HTTPS everywhere extensions. – Mittenchops Nov 21 '12 at 01:20
  • In our case, we were getting the wrong content type back when requesting css. requested: Accept:text/css,*/*;q=0.1, responded: Content-Type:text/plain. Ended up switching hosting providers to fix it.. too bad chrome isn't smart enough to know .css when it sees it.. – MonkeyD Apr 11 '13 at 14:51
  • I have the same problem and only on MacOS (the same Chrome version on Windows doesn't have this problem). The only thing I know so far is that with removing comments at the beginning of the css files with the DevTools of Chrome seem to solve the issue. Maybe that helps even if I don't know why it is that way. – Niklas P Oct 07 '21 at 16:48

7 Answers7

16

Do you have HTTPS everywhere + Adblock installed? If so, I've found that clicking through google search results will often produce this behavior when the main site has no, or limited https support.

I notice the same behavior, with those extensions, when I search for and click through an XKCD comic, for example.

Temporarily disabling https everywhere, or re-entering the URL without https seems to fix it for me.

Mittenchops
  • 18,633
  • 33
  • 128
  • 246
  • 1
    I don't have HTTPS Everywhere, and both links fail to load CSS pretty often on random websites for me... – Shackrock Jun 04 '13 at 22:11
  • Why would adblock do this for a stylesheet in one directory of my server, but not in another directory? In the directory where the stylesheet fails to load, `index` and the stylesheet are in the same directory. Is there some header I should add? Some other reason? – 1252748 Nov 06 '13 at 16:46
  • 2
    After disabling "AdBlock" extension in google chrome, everything is working fine for me. Thanks. – Vinay Jeurkar Dec 07 '13 at 10:00
  • "avast! Online Security" bit me with this, on UserVoice. – Grault Jan 01 '14 at 08:19
6

Maybe a caching problem on your side. Can you try "Shift+Ctrl+R"?

Jhourlad Estrella
  • 3,545
  • 4
  • 37
  • 66
2

Had this same issue, spent hours going around in circles wondering "What the hell have I done!", I tried many of the suggestions from this site and many others but the thing that worked for me and I felt kind of stupid afterwards for not trying it was to disable ad-blocker for chrome, followed by a shift+f5 and problem solved.

sean
  • 21
  • 1
2

I tried this on OS X with the same Chrome version as you and everything is rendered correctly for the dark and light versions. It could be a caching problem for you. Hold down the shift key while you reload the page. This will force the browser to get all of the resources and ignore the cached versions.

John Keyes
  • 5,479
  • 1
  • 29
  • 48
  • That was the first thing I tried, no luck. I've also cleared browsing data from "the beginning of time" from chrome options, same result. – GreatestSwordsman Oct 03 '11 at 00:04
  • Open the web inspector and goto the Network tab. When you reload you will see what resources are being downloaded. – John Keyes Oct 03 '11 at 00:05
  • The only other thing I can think of is some JavaScript is breaking the site. You could try commenting them out one-by-one. (The fact that it works okay for me suggests this is not the case though) – John Keyes Oct 03 '11 at 00:15
  • hey, it is some javascript. It's something located on this file: http://pastebin.com/raw.php?i=BcRd6VPs I'm not very good with javascript, are you able to identify the problem? – GreatestSwordsman Oct 07 '11 at 01:27
0

On my friend's laptop it was caused by some DNS problems. After changing DNS to 8.8.8.8 everything is fine.

int_ua
  • 1,646
  • 2
  • 18
  • 32
0

Change css charset to UTF8. It fixed my issue.

Kavin
  • 332
  • 2
  • 8
0

I had this issue. It started when I added a Chrome extension 'Akamai Debug Headers'. This caused random sites' CSS not to load and displayed CORS errors.

I turned off the extension and it all worked again.

So maybe disable all extensions and then test Chrome