页面在线呈现问题,但在 Chrome 中本地保存和加载时工作正常

发布于 2025-01-08 07:08:49 字数 319 浏览 0 评论 0原文

我有一个相当简单的页面(http://www.kwatee.net),可以在 Firefox、Opera、 Safari 和 IE 但在 Chrome (v17.0.963.56) 上有问题。我在本地保存了页面并加载了它 (file:///...),它在 Chrome 中按预期呈现!

我查看了 Chrome 开发者工具,由于某种原因,Chrome 似乎没有在线“看到”我的样式表 (stylesheet.css),但它对我之后的页面感到满意保存到本地。

I have a fairly straightforward page (http://www.kwatee.net) that renders ok with Firefox, Opera, Safari and IE but has problems with chrome (v17.0.963.56). I saved the page locally and loaded it (file:///...) and it renders as expected in Chrome!

I had a look with the Chrome developer tools and it looks like, for some reason, Chrome does not 'see' one of my style sheets (stylesheet.css) online but it's happy with the page after I save it locally.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

救赎№ 2025-01-15 07:08:49

appengine sdk 版本 1.6.2.1 已修复该问题

The problem is fixed with version 1.6.2.1 of appengine sdk

々眼睛长脚气 2025-01-15 07:08:49

我也在使用 Chrome,所以我做了一些挖掘,它给了我这个错误:
“资源解释为样式表,但使用 MIME 类型 text/plain 进行传输:”http://www.kwatee.net /stylesheet.css“。”
(打开 Chrome 开发人员工具,转到控制台,然后重新加载页面)

由于某种原因,服务器未发送正确的 MIME 类型,网络选项卡确认了这一点。我会检查服务器端设置,或者测试简单地删除 type 属性或将其更改为 type="text/plain"

另请参阅:

资源解释为样式表但使用 mime 类型文本普通问题进行传输?

Chrome显示“资源解释为脚本但使用MIME 类型 text/plain。”,什么给出?

I am also using Chrome, so I did a little digging and it is giving me this error:
"Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://www.kwatee.net/stylesheet.css"."
(Open the chrome developer tools, goto console, and reload the page)

For some reason the server is not sending the correct MIME type, the networking tab confirms this. I would check the server-side settings, or test simply removing the type property or changing it to type="text/plain"

See also:

resource interpreted as stylesheet but transferred with mime type text plain issue?

Chrome says "Resource interpreted as script but transferred with MIME type text/plain.", what gives?

乖乖兔^ω^ 2025-01-15 07:08:49

您的网站无法在 Safari Mac 中正确呈现,Safari Mac 也是一个 Webkit 浏览器,如 Chrome。

我尝试在 Safari (Mac) 中提取您的样式表,它下载到我的桌​​面而不是显示其内容内容。这不是正常行为。奇怪的是,你的其他样式表显示得很好。

主要区别是 stylesheet.css 开头的空行...这应该不重要,但删除空行只是为了确定。

但是,我无法在我的帐户上重现该问题,因此请彻底检查您的服务器设置。 (我将与您完全相同的 stylesheet.css 上传到我自己的托管帐户,并通过 URL 将其拉到我的浏览器中。它显示在浏览器中,但没有下载到我的桌​​面。这表明了一些情况您的服务器上的设置不同。)


附带问题:我还看到 您的页面未验证

您需要根据验证错误修复 标记

并且还要删除 doctype 上方的所有空格,否则 IE 将进入怪癖或兼容模式。

Your site does not render properly in Safari Mac which is also a Webkit browser like Chrome.

I tried pulling up your stylesheet in Safari (Mac) and it downloaded to my desktop instead of displaying its contents. This is not normal behavior. Strangely, your other stylesheet displays just fine.

The main difference is the blank line at the start of stylesheet.css... it should not matter but remove the blank line just to be sure.

However, I cannot reproduce the issue on my account, so thoroughly check your server settings. (I uploaded your exact same stylesheet.css to my own hosting account and pulled it up in my browser via URL. It displayed in the browser and did not download to my desktop. This suggests something is setup differently on your server.)


Side-issue: I also see that your page does not validate.

You need to fix the <html> tag as per the validation error

<html xmlns="http://www.w3.org/1999/xhtml">

And also remove all the whitespace above your doctype as IE will go into quirks or compatibility mode otherwise.

乙白 2025-01-15 07:08:49

您的网络服务器当前返回“null”作为 CSS 文件的内容类型。

尝试设置 Web 服务器以返回正确的 Content-Type 标头。对于 Apache 服务器,可以通过将以下行添加到 .htaccess 文件中来完成:

AddType text/css .css

Your web-server is currently returning "null" as Content-Type for CSS files.

Try to setup web-server to return proper Content-Type header. For Apache server, this can be done by adding following line to .htaccess file:

AddType text/css .css
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文