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

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

问题描述

我在浏览 Amazon 时发现在搜索1TB" 如果您将鼠标光标悬停在星级评分图像上,您只会如果使用 IE,请查看分数.如果您使用的是其他浏览器,则不会显示分数.

I was browsing Amazon and I noticed that when searching "1TB" if you hover the mouse cursor 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?

推荐答案

我会两者兼而有之.标题将在所有浏览器中显示一个很好的工具提示,当在没有图像的浏览器中浏览时,alt 将给出描述.

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 调制解调器连接互联网的日子已经一去不复返了.

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天全站免登陆