请参阅此处示例http://jsbin.com/elesa
码
<p>
<a target="_blank" href="#" title="Download PDF, 58KB, opens in a new window">
<img width="150" height="50" border="0" src="http://sstatic.net/so/img/logo.png" alt=""/>
</a>
</p>
答案 0 :(得分:2)
浏览器以不同的方式优先考虑title
和alt
。获得正确结果的最安全方法是在图像的title
和alt
标记上提供相同的标题。例如:
<a target="_blank" href="#" title="Download PDF, 58KB, opens in a new window">
<img width="150" height="50" border="0" src="http://sstatic.net/so/img/logo.png"
alt="Download PDF, 58KB, opens in a new window"/>
</a>