在MouseOver上显示HTML文件中的图片 [英] Display text on MouseOver for image in html

查看:79
本文介绍了在MouseOver上显示HTML文件中的图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我如何在HTML / JS中执行此操作?


<您可以使用 title 属性。

 < img src =smiley.giftitle =笑脸/> 

您可以随意更改图片来源。



以及 @Gray 评论道:



您还可以在< a ... 锚点,等其他物品上使用标题 < p为H. < DIV> <输入>
请参阅:


I would like to display text when the user mouseovers the image.

How can I do this in HTML/JS?

解决方案

You can use title attribute.

<img src="smiley.gif"  title="Smiley face"/>

You can change the source of image as you want.

And as @Gray commented:

You can also use the title on other things like <a ... anchors, <p>, <div>, <input>, etc. See: this

这篇关于在MouseOver上显示HTML文件中的图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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