问题描述
自从我进行了严肃的网络开发以来已经有一段时间了。现在我遇到了一系列我不熟悉的全新问题..
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..
我的网页上有各种图标的.png图像。我发现每当我编辑这些图像时,它们就会停止在IE8中的页面内工作。也就是说,它们(通常)在我第一次打开页面时显示OK,然后在刷新时被占位符图标替换。有时,一些图标显示,而其他图标显示相同的src,不会。
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).
如果我直接在IE中打开图像(即。不在页面内),它们工作正常。
If I open the images directly in IE (ie. not within the page), they work just fine.
我使用Paint.NET编辑图像,但也尝试用Paint保存它们。
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.
这里发生了什么?
推荐答案
好吧,我们每天都学到新的东西..
Well, we learn something new every day..
我提到我直接在硬盘上运行它?现在,事实证明,html页面(我从同事那里得到的)被阻止以帮助保护我的计算机,就像Windows一样。
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).
然而,似乎当IE8加载这样一个被阻止的HTML文件时,它的安全设置会以某种方式进行调整,而且 - 我只能猜测细节,但只要我右键单击HTML文件,就会选中属性并单击解除阻止按钮,问题就消失了。
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.
这篇关于.png图像仅在IE8中显示,但不在页面内显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!