IE7 和 8 在 CSS 图像上随机挂起

发布于 2024-08-30 15:26:35 字数 714 浏览 2 评论 0原文

我们有一个 ASP.NET 3.5 应用程序,已经投入生产一年多了。我们的最后一次发布是在几个月前。我们使用 CSS 来设计样式并将背景图像应用到 div 等。服务器是Windows 2003,带有IIS。

突然,本周,我们收到一些用户的报告,称页面在加载时似乎挂起。状态栏显示页面主区域中使用的背景图像的名称(在 CSS 中分配)。在我们的办公室,我们中的一些人可以重现这个问题,而另一些人则不能。 IE6和Firefox似乎不受影响,只有IE7/8。在受影响的机器上运行 Fiddler 并尝试查看请求发生了什么似乎可以使问题消失(通过 Fiddler 运行时,它会在没有运行时返回)。在挂起的加载上点击“刷新”通常会使页面加载正常。

我检查了背景图像,甚至用存档副本替换了它。没有喜悦。我们从生产源重新部署了该应用程序。没有喜悦。我们重新启动 IIS,并最终重新启动整个服务器。事件日志、应用程序日志或 IIS 日志中没有异常条目。最后,我完全删除了图像并重新设计了页面样式以不使用背景图像。这至少暂时解决了问题。

然而,我们有报道称其他图像“悬挂”。这些图像是 PNG 格式,但我听到一些传言称有时 GIF 会挂起,但我没有屏幕截图可以确认。

这一切“突然”开始发生。最近没有任何版本或更新应用于服务器。我们甚至检查了客户端上的更新,看看最近的 Windows 更新是否可能导致客户端出现此问题,但过去几周内没有任何更新。

如果您有任何有关此问题的信息,我很乐意听取您的意见。我也非常感谢任何有关我们可以尝试的其他诊断的建议。

We have an ASP.NET 3.5 application that has been in production for over a year. Our last release was a couple of months ago. We use CSS for styling and application of background images to divs and such. The server is Windows 2003 with IIS.

Suddenly, this week, we have had reports from some users that the page seems to hang up while loading. The status bar was showing the name of a background image used in the page main area (assigned in CSS). At our office, some of us could recreate the problem, while others could not. IE6 and Firefox do not seem to be affected, only IE7/8. Running Fiddler on an affected machine and trying to see what was happening with the requests seemed to make the problem go away (while running through Fiddler, it returned when not). Hitting Refresh on a hung load often made the page load just fine.

I checked the background image, and even replaced it with an archived copy. No joy. We re-deployed the app from our production source. No Joy. We restarted IIS and eventually rebooted the whole server. There are no unusual entries in the event logs, the app logs or the IIS logs. Finally, I removed the image entirely and re-styled the page not to use a background image. That solved the problem at least for now.

However, we have reports of other images "hanging." The images are PNGs, but I have heard some rumors that sometimes a GIF hangs, but I have no screenshot to confirm.

This just started happening "out of the blue." There have been no releases or updates applied to the server recently. We even checked updates on clients to see if a recent Windows Update might have caused this on the client, but there was nothing updated within the last couple of weeks.

If you have any information about this problem, I would love to hear from you. I would also greatly appreciate any recommendations on additional diagnostics we can try.

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

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

发布评论

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

评论(5

不交电费瞎发啥光 2024-09-06 15:26:36

我可以建议你仔细看看你的 PNG 版本/内容吗?

PNG 文件支持 Alpha 通道,它提供了一种透明度。 IE 6 不支持 Alpha 通道,因此可能会以不同的方式处理您的图像。 IE 7 和8 支持 Alpha 通道。

Can I suggest you look harder at your PNG version / content?

PNG files support alpha-channels, which provide a form of transparency. IE 6 does NOT support alpha channels and therefore may be processing your images differently. IE 7 & 8 do support alpha channels.

梦里°也失望 2024-09-06 15:26:36

图像是否托管在与主站点相同的服务器/网站上?可能是网络/DNS 问题吗?

Are the images hosted on the same server/website as the main site? Could it be a network/DNS issue?

姐不稀罕 2024-09-06 15:26:36

图像名称“camelCased”或“PascalCased”是偶然的吗?我们遇到了图像并非全部小写的问题。另外,如果您迁移到 S3 等 CDN,您会希望所有内容都小写(以防万一)。

请发布 CSS 和文件的模糊路径。

Are the image names camelCased or PascalCased by chance? We had issues with images that were not all lowercased. Also, if you move to a CDN such as S3, you will want everything to be lowercased (just in case).

Pls post CSS and an obfuscated path to the file.

燕归巢 2024-09-06 15:26:36

您的 Intranet 和外部资源上是否都会发生这种情况?这个在内网外测试过吗? (这听起来可能与DNS有关。)

Does this happen on both your Intranet and outside sources? Has this been tested outside the internal network? (This sounds like it may be related to DNS.)

2024-09-06 15:26:36

显然,这个错误有很多可能性,但我遇到了这个问题,我能够解决这个问题,所以我想我会与社区分享我的解决方案。

我有类似

background-image: url("/myapp/images/expand_title_off.gif"); 
background-repeat: no-repeat; 
background-position: center center; 

span 元素的 style 属性内部的东西。

对于 IE7,我将所有这些组合到一个背景属性中,就像

background:url("/myapp/images/expand_title_off.gif") no-repeat center center;

IE7 在尝试使用特定属性时看起来不太友好。对我来说,旧的和新的样式在 chrome 上都工作得很好,所以绝对是 IE7 的问题。

There are a number of possibilities for this bug obviously, but I faced the problem, I was able to fix the problem, and so I thought I would share with the community my fix.

I had something like

background-image: url("/myapp/images/expand_title_off.gif"); 
background-repeat: no-repeat; 
background-position: center center; 

inside of a style attribute for a span element.

For IE7, I combined all of these into a single background property like

background:url("/myapp/images/expand_title_off.gif") no-repeat center center;

IE7 did not look too kindly on trying to use the specific properties. For me, both the old and the new styles worked just fine with chrome, so definitely an IE7 issue.

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