.png 图像仅在 IE8 中显示,但不在页面内显示

发布于 2024-08-14 03:31:19 字数 543 浏览 3 评论 0原文

我已经有一段时间没有认真进行网络开发了。现在我遇到了许多我不再熟悉的全新问题。

我的网页中有一些用于各种图标的 .png 图像。我发现每当我编辑这些图像时,它们就会停止在 IE8 的页面内工作。也就是说,当我第一次打开页面时,它们(通常)显示“确定”,然后在刷新时被占位符图标替换。有时,某些图标会显示,而其他具有相同源的图标则不会显示。

我的图像标签没什么奇特的,通常是:

<img src="images/misc/smallreport.png" alt="Report" />

当我右键单击页面中的图标并选择“属性”时,协议、类型、地址和大小显示为“不可用”,并且尺寸不正确(占位符的大小、我敢打赌)。

如果我直接在 IE 中打开图像(即不在页面内),它们就可以正常工作。

我已经使用 Paint.NET 来编辑图像,但也尝试使用 Paint 保存它们。

现在,我直接在硬盘上工作(即不通过网络服务器)。而且,哦,是的,这一切都不会发生在 Google Chrome 中。

这是怎么回事?

It's been a while since I did serious web development. Now I meet a host of brand new problems I'm no longer familiar with..

I have some .png images for various icons in my web page. What I find is that whenever I edit these images, they stop working inside a page in IE8. That is, they (usually) display OK when I first open the page, then are replaced by the placeholder icon on refresh. Sometimes, some of the icons display and others, with the same src, don't.

My image tags are nothing fancy, typically:

<img src="images/misc/smallreport.png" alt="Report" />

When I right-click an icon in the page and select "properties", protocol, type, address and size are shown as "Not Available", and dimensions are incorrect (size of the placeholder, I bet).

If I open the images directly in IE (ie. not within the page), they work just fine.

I have used Paint.NET to edit the images, but have also tried saving them with Paint.

Right now, I am working right off the hard disk (ie. not through a web server). And, oh yes, none of this happens in Google Chrome.

What's going on here?

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

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

发布评论

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

评论(4

撧情箌佬 2024-08-21 03:31:19

检查文件路径是否正确 - 我们可以查看标签吗?

check the path to the file is correct - can we see the tag please.

|煩躁 2024-08-21 03:31:19

好吧,我们每天都会学到新东西..

我提到过我直接从硬盘上运行这个?现在,事实证明,html 页面(我从同事那里得到的)被阻止“以帮助保护我的计算机”,就像 Windows 一样。

这并不奇怪,我正在使用的许多文件都源自其他计算机,而且我通常不太担心它(可执行文件除外,它们在解锁之前不会运行)。

然而,似乎当 IE8 加载这样一个被阻止的 HTML 文件时,它的安全设置会以某种方式进行调整,并且 - 好吧,我只能猜测细节,但是当我右键单击该 HTML 文件,选择“属性”并单击“解锁”按钮,问题就消失了。

Well, we learn something new every day..

I mentioned that I'm running this directly off the harddisk? Now, it turns out the html page (which I had gotten off a coworker) was blocked "to help protect my computer", as Windows does.

This is no big surprise, lots of files I'm working with originate on other computers, and I usually don't worry much about it (except with executables, which won't run until unblocked).

It seems, however, that when IE8 loads such a blocked HTML file, its security settings adjust somehow, and - well, I can only guess at the details, but as soon as I right-clicked the HTML file, selected Properties and clicked the "unblock" button, the problem went away.

紫南 2024-08-21 03:31:19

类似的事情曾经发生在我身上,我努力找出问题所在,然后我意识到我正在将文件(从 Photoshop)保存为 PSD,但扩展名为 .png。确保你没有做同样的事情。

另外:

  • 清除临时 Internet 文件
  • 验证“显示图片”选项是否未关闭
  • 确保 Toggle Images.exe Web 附件不存在并禁用图像
  • 确保第三方 Internet 安全、防火墙或 cookie 阻止程序不是导致问题的原因
  • 启用自动选择编码选项

来源

Something similar happened to me once, I tried hard to find what was wrong, then I realized I was saving (from Photoshop) the file as PSD but with extension .png. Make sure you're not doing the same.

Also:

  • Clear temporary Internet files
  • Verify that the Show Pictures option has not been turned off
  • Make sure that the Toggle Images.exe Web accessory is not present and disabling images
  • Make sure that a third-party Internet security, firewall, or cookie-blocking program is not causing the problem
  • Enable the Auto-Select encoding option

Source

夏の忆 2024-08-21 03:31:19

可能是您浏览的网站缺乏支持
对于 IE 浏览器。 IE 是所有 Web 开发人员的噩梦。网页设计师。
可能是该网站的开发者不喜欢 IE 显示,因为
IE 问题。也许 IE 正在尝试创建一个 Web 标准来提高它们的性能
销售和营销策略。这就是为什么不关心现代 Web 开发标准。
为什么选择 Chrome、Firefox 或 Safari,反正都是免费的。

It might be that the website you have browse has a lack of support
for an IE browser. IE is a nightmare for all web developers & Web designers.
It might be the developer of that website didn't care for an IE display because
of IE issues. Perhaps IE is trying to create a web standard to increase their
sales and marketing strategy. That's why don't care the modern Web development standard.
Why Chrome or Firefox or Safari, it's a free anyway.

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