Chrome 未加载样式表
似乎 Google Chrome 没有根据样式表显示我的网站。
当页面第一次加载时,它加载得很好......但随后它会在页面加载结束时更改为原始 html 格式。
它最终看起来像这样(您可以在顶部栏看到网址):
我有 2 个样式表,一个是用户可以通过以下方式切换的“替代”样式表单击顶部的浅色/深色按钮网站右侧。
为什么会发生这种情况?我以前从未遇到过问题。
我的规格:Mac OS X 和 Google Chrome 14.0.835.186
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):
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您是否安装了 HTTPS 无处不在 + Adblock?如果是这样,我发现当主站点没有或有限的 https 支持时,点击 google 搜索结果通常会产生这种行为。
例如,当我搜索并单击 XKCD 漫画时,我注意到使用这些扩展的相同行为。
暂时禁用所有地方的 https,或者重新输入不带 https 的 URL 似乎可以解决这个问题。
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.
也许是你这边的缓存问题。你能尝试“Shift+Ctrl+R”吗?
Maybe a caching problem on your side. Can you try "Shift+Ctrl+R"?
我在 OS X 上尝试了与您相同的 Chrome 版本,并且所有内容都在深色和浅色版本中正确呈现。这对你来说可能是一个缓存问题。重新加载页面时按住 Shift 键。这将强制浏览器获取所有资源并忽略缓存的版本。
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.
遇到了同样的问题,花了几个小时绕圈想知道“我到底做了什么!”,我尝试了这个网站和其他许多网站的许多建议,但对我有用的东西,事后我觉得有点愚蠢,因为没有尝试禁用 chrome 的广告拦截器,然后按 Shift+F5 并解决问题。
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.
在我朋友的笔记本电脑上,这是由一些 DNS 问题引起的。将 DNS 更改为 8.8.8.8 后一切正常。
On my friend's laptop it was caused by some DNS problems. After changing DNS to 8.8.8.8 everything is fine.
将 css 字符集更改为 UTF8。它解决了我的问题。
Change css charset to UTF8. It fixed my issue.
我有这个问题。当我添加 Chrome 扩展“Akamai 调试标头”时,它就开始了。这导致随机站点的 CSS 无法加载并显示 CORS 错误。
我关闭了扩展程序,一切又恢复了。
所以也许禁用所有扩展然后测试 Chrome
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