HTML img标签:标题属性与alt属性? [英] HTML img tag: title attribute vs. alt attribute?

查看:118
本文介绍了HTML img标签:标题属性与alt属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我浏览Amazon.com时发现,当搜索1TB( http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&field-keywords=1TB )如果将鼠标移动到星级评分图片,你只有使用IE才能看到分数。如果您使用的是其他浏览器,则分数将不会显示。

I was browsing Amazon.com and noticed that when searching "1TB" (http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&field-keywords=1TB) if you move the mouse over the stars rating image, you only see the score if using IE. If you are using another browser then the score won't show.

3.8的评分和4.2的评分均显示为4星。当然,3.8星和4.2星(76%对84%的分数)可能会有所不同!

A rating of 3.8 and a rating of 4.2 both show up as 4 stars. Of course a 3.8 stars vs 4.2 stars (76% vs 84% score) could make a difference!

这是因为显示alt文本的标准方式只是当用户关闭图形或浏览器被读出时(例如,浏览器供视力受损用户使用)。 IE浏览器显示它悬停。

This is because the standard way of displaying "alt" text is only when the user turns off graphics or when the browser is "read out" (e.g browser for users who are visually impaired). IE however, shows it on hover.

所以我认为如果亚马逊不管用户的浏览器如何显示它,那么除了alt之外,还应该使用title 。你同意吗?

So I think if Amazon is to show it regardless of the user's browser, then "title" should be used in addition to "alt". Would you agree?

推荐答案

我会为两者而努力。标题将在所有浏览器中显示一个很好的工具提示,并且在没有图像的浏览器中浏览时会给出说明。

I'd go for both. Title will show a nice tooltip in all browsers and alt will give a description when browsing in a browser with no images.

也就是说,我希望看到一些统计信息有多少冲浪者去那里去商店浏览商品,实际上图片已关闭或正在使用不支持图片的浏览器。我认为90%的人口使用28k调制解调器连接到InterWeb的日子已经过去了。

That said, I'd love to see some stats of how many "surfers" out there going to a "store" to browse merchandise actually have images turned off or are using a browser that doesn't support images. I think the days where 90% of the population is using a 28k modem to connect to the InterWeb is looooong over.

这篇关于HTML img标签:标题属性与alt属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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