Firefox和IE8的问题没有显示图像映射的鼠标悬停替代文字

Jod*_*oda 1 html map mouseover tooltip

我有以下HTML:

<div style="position: relative; text-align: left;">
<img id="chart_6c544b37_ac9d_49ed_912e_5ff8ad6c0181_BaseImage" src="chart.gif" width="460px" height="240px" usemap="#chart_6c544b37_ac9d_49ed_912e_5ff8ad6c0181" border="0">

<map name="chart_6c544b37_ac9d_49ed_912e_5ff8ad6c0181">
<area shape="poly" alt="Second Dot" coords="256,51,259,48,256,45,253,48"></area>
<area shape="poly" alt="First Dot" coords="183,51,186,48,183,45,180,48"></area>
</map>
</div>
Run Code Online (Sandbox Code Playgroud)

当我使用IE7时将鼠标悬停在图表上的区域上时,Alt文本("第一点"和"第二点")正确显示为工具提示,但在使用Firefox或IE8时它们不会显示.

有什么想法吗?

这个例子可以在这里看到

Kor*_*tor 7

alt仅在无法加载图像时显示该属性.请改用该title属性.

  • 如果标题不存在,某些浏览器会使用`alt`标记 - 这就是您看到所看到内容的原因 (2认同)