Alt 标签未显示在浏览器上 [英] Alt tag not displayed on browser

查看:35
本文介绍了Alt 标签未显示在浏览器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 HTML 测试我的代码,以确保我已正确完成所有操作,而且我似乎无法在浏览器上显示替代文本.我尝试使用最新版本的 Chrome 和 Firefox..

I'm testing my code in HTML to make sure I've done everything correctly and I can't seem to get the alt text displayed on my browser. I tried with latest version of Chrome and Firefox..

<center>
<img src="http://www.opstinavinica.gov.mk/vinica/images/logogd.png" align=top alt="E ova e logoto!!!!">Ova e logoto na <b>UGD</b>
</center>

对不起,外语.如果需要,我可以翻译.

Sorry about the foreign language.. I can translate it if necessarry.

如果 alt 仅用于显示损坏图像的文本,则当鼠标悬停在图像上时显示文本的标签是什么?

What is the tag to display text while mouse is over the image if alt is for displaying text for broken images only?

推荐答案

alt 属性设置或返回图像的 alt 属性的值.

The alt property sets or returns the value of the alt attribute of an image.

必需的 alt 属性指定图像的替代文本,如果图像由于某种原因无法显示(因为连接速度慢、src 属性中的错误,或者如果用户使用屏幕阅读器).

The required alt attribute specifies an alternate text for an image, if the image for some reason cannot be displayed (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

注意:当鼠标悬停在 img 元素上时,Internet Explorer 会将 alt 属性的值显示为工具提示.根据 HTML 规范,这不是正确的行为.所有其他浏览器都遵循规范,只有在无法显示图像时才会显示替换文字.

Note: Internet Explorer displays the value of the alt attribute as a tooltip when mousing over the img element. This is NOT the correct behavior, according to the HTML specification. All other browsers are following the specification, and will only display the alt text if the image cannot be displayed.

这篇关于Alt 标签未显示在浏览器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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