Ach*_*ius 70 html google-chrome
除非调整图像的宽度,否则包含无效源的图像会在Firefox中显示替代文本,但不会显示在chrome中.
<img height="90" width="90"
src="http://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif"
alt="Image Not Found"/>
Run Code Online (Sandbox Code Playgroud)
如何显示图像的替代文字?
rah*_*hul 24
您可以使用该title
属性.
<img height="90" width="90"
src="http://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif"
alt="Google Images" title="Google Images" />
Run Code Online (Sandbox Code Playgroud)
是的,这是 webkit 中的一个问题,也在 chromium 中报告:http://code.google.com/p/chromium/issues/detail ?id=773 自 2008 年以来就存在......但仍未修复!
我正在使用 javacsript 和 jQuery 来解决这个问题。
function showAlt(){$(this).replaceWith(this.alt)};
function addShowAlt(selector){$(selector).error(showAlt).attr("src", $(selector).src)};
addShowAlt("img");
Run Code Online (Sandbox Code Playgroud)
如果您只想要一张图片:
addShowAlt("#myImgID");
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
130138 次 |
最近记录: |