Firefox 显示损坏的图像
在 Firefox 中,损坏的图像仅显示为空白。在白色背景上,无法区分无图像和损坏的图像。这使得识别损坏的图像变得难以识别并且无法纠正。
如何使损坏的图像像在 Internet Explorer 中一样产生 X?
In firefox a broken image appears as just a blank white space. On a white background there is no way to distinguish between no image and a broken image. This makes identifying broken images difficult to recognise and makes them go uncorrected.
How do I make it so that broken images produce an X like they do in Internet Explorer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我知道这个问题不久前被问过,但我不久前写了一篇关于这个问题的博客文章,并认为它可能值得 添加链接,以防有人遇到它。
编辑 09/12/2013:
KatieK 在下面提出了关于直接在答案中添加信息的好观点,以下是使其正常工作所需的步骤,在截至 2013 年 12 月 (v28a2) 的最新夜间构建中仍然相关
1) 类型 <将 Strong>about:config 插入地址栏并接受警告
2) 搜索 browser.display.show_image_placeholders 并设置为 true
3) 搜索您的 Fx 配置文件UserContent-example.css 文件夹并将其重命名为 UserContent.css (如果示例文件不存在,您可以创建它)
4)将以下 css 添加到您的 UserContent.css 并重新启动 Firefox
I know this question was asked a while ago but I wrote a blog post on this issue a while back and thought it might be worth adding a link in case anyone falls across it.
Edit 09/12/2013:
KatieK made a good point below about adding the information directly in the answer, here are the required steps to get this working, still relevant in the latest nightly build as of Dec 2013 (v28a2)
1) type about:config into your address bar and accept the warning
2) search for browser.display.show_image_placeholders and set to true
3) search your Fx profile folder for UserContent-example.css and rename it to UserContent.css (if the example file doesnt exists you can just create it)
4) add the following css to your UserContent.css and restart Firefox
在 Firefox 中显示损坏图像图标的最佳解决方案 -
安装 Greasemonkey (https://addons.mozilla。 org/en-US/firefox/addon/greasemonkey/)并安装破碎图像图标脚本(http://userscripts.org/scripts/show/104265)
The best solution to show broken image icon in Firefox -
install Greasemonkey (https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) and install Broken Image Icon Script (http://userscripts.org/scripts/show/104265)
更好的是,从 Mozilla 附加组件中获取 Web 开发人员工具栏地点。安装完成后,只需转到“图像”>“找到破损的图像。
Even better, grab the Web Developer Toolbar from the Mozilla Add-ons site. Once you get it installed, simply go to Images > Find Broken Images.
给出的所有解决方案都运行良好。只是另一种情况会导致图像损坏以及不同的解决方案。
您热链接图像。您无法控制最终返回 404 并希望向用户显示某些内容的图像。您可以使用 css 和显示图像的正确宽度/高度来防止这种情况。
您的背景文件将有一个十字或一条文字,说明该图像不再可用。只是一个想法。
希望有帮助。
All solutions given work well. There is just another situation where images will be broken and a different solution.
You hot-link images. You have no control on the images that will eventually return a 404 and want to display something to the user. That you can prevent with css and with the correct width/height of the image on display.
And your background file would have a cross or a text saying that the image is not available anymore. Just a thought.
Hope it helps.
更好的解决方案可能是捕获返回 404 Not Found 错误的图像请求。
在 Firefox 中,您可以使用 Firebug 查看浏览器发出的所有 HTTP 请求。任何丢失的文件将在列表中显示为红色。要在 Internet Explorer 中实现相同的目的,您可以使用 Microsoft 的 Fiddler 工具。
A better solution might be to catch requests for images that return a 404 Not Found Error.
In Firefox you can use Firebug to look at all the HTTP requests being made by your browser. Any missing files will show up as red in the list. To achieve the same in Internet Explorer you could use Microsoft's Fiddler tool.
我在 FF 中遇到问题,并且在确信包含图像时错过了检查。由于图像未上传到文件夹或其他原因,没有检测到这一点,并且 FF 由于 alt 为空而没有说什么。
我在这里发布了解决方案: http:// /www.satya-weblog.com/2010/07/display-broken-images-in-firefox.html
I faced problem in FF and missed to check when I was confident that images are included. That does not got detected either due to image not get uploaded to folder or some other reason and FF does not said anything due to empty alt.
Here I have posted the solution: http://www.satya-weblog.com/2010/07/display-broken-images-in-firefox.html
该插件通过扫描当前访问的网站及其所有嵌入的样式表来检测不可用的图像:
https://addons.mozilla.org/de/firefox/addon/broken-image-finder/
this add-on detects unavailable images by scanning the currently visited website and all its embedded stylesheets:
https://addons.mozilla.org/de/firefox/addon/broken-image-finder/