如何在Chrome中显示图像的替代文字 [英] How to display alt text for an image in chrome

查看:198
本文介绍了如何在Chrome中显示图像的替代文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有无效来源的图片在Firefox中显示替代文字,但不会在Chrome中显示,除非调整图片的宽度。

The image with invalid source displays an alternate text in Firefox but not in chrome unless the width of an image is adjusted.

  <img height="90" width="90"
    src="http://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif"
    alt="Image Not Found"/>

如何显示图片的替代文字?

How to display the alt text for an image?

推荐答案

如果我是正确的,这是webkit中的一个错误(根据这个)。我不确定是否有很多可以做的事,对于弱的答案感到抱歉。

If I'm correct, this is a bug in webkit (according to this). I'm not sure if there is much you can do, sorry for the weak answer.

然而,您可以使用一项工作。如果您向图片添加 标题 属性(例如 title =找不到图片)它会工作。

There is, however, a work around which you can use. If you add the title attribute to your image (e.g. title="Image Not Found") it'll work.

这篇关于如何在Chrome中显示图像的替代文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆