Javascript html中的鼠标悬停效果

Javascript html中的鼠标悬停效果,javascript,html,css,Javascript,Html,Css,请用示例告诉我html语法,这样当我创建超链接图像时,我会在图像旁边生成一条注释,说明此链接将做什么?你的意思是像悬停在消息上一样?只需在链接标记中添加标题即可: <a title="add a comment to this post">add comment</a> 添加注释 你的意思是像一个悬停在消息上的鼠标?只需在链接标记中添加标题即可: <a title="add a comment to this post">add comment</a&

请用示例告诉我html语法,这样当我创建超链接图像时,我会在图像旁边生成一条注释,说明此链接将做什么?

你的意思是像悬停在消息上一样?只需在链接标记中添加
标题即可:

<a title="add a comment to this post">add comment</a>
添加注释

你的意思是像一个悬停在消息上的鼠标?只需在链接标记中添加
标题即可:

<a title="add a comment to this post">add comment</a>
添加注释

我想是这样的:

<img src="worldmap.jpg" alt="Worldmap" title="Map of the World" usemap="#world">

<map name="world">
<area href="uk.html" alt="United Kingdom" title="United Kingdom" shape="poly" coords="150,217,190,257,150,297,110,257">
<area href="us.html" alt="United States" title="United States" shape="poly" coords="10,20,100,20,120,100,5,110">
</map> 

我想是这样的:

<img src="worldmap.jpg" alt="Worldmap" title="Map of the World" usemap="#world">

<map name="world">
<area href="uk.html" alt="United Kingdom" title="United Kingdom" shape="poly" coords="150,217,190,257,150,297,110,257">
<area href="us.html" alt="United States" title="United States" shape="poly" coords="10,20,100,20,120,100,5,110">
</map> 

对于系统标准工具提示,请使用(适用于几乎所有元素;仅接受文本,某些浏览器在几百个字符后截断):


要在悬停时显示任意内容,请执行以下操作:

a:not(:hover) .supplement { display: none; }
a .supplement { position: absolute; }
...
<a href="url">link contents <span class="supplement">supplemental text</span></a>
a:not(:hover)。补充{display:none;}
a.补编{立场:绝对;}
...

顺便说一句,无论“链接内容”是文本还是图像,此选项都有效。

对于系统标准工具提示,请使用(适用于几乎任何元素;仅接受文本,某些浏览器在几百个字符后截断):

<a href="http://www.google.com" title="Go to google"><img src="/images/yourimage.png" /></a>

要在悬停时显示任意内容,请执行以下操作:

a:not(:hover) .supplement { display: none; }
a .supplement { position: absolute; }
...
<a href="url">link contents <span class="supplement">supplemental text</span></a>
a:not(:hover)。补充{display:none;}
a.补编{立场:绝对;}
...
顺便说一句,不管“链接内容”是文本还是图像,这都是有效的。


<a href="http://www.google.com" title="Go to google"><img src="/images/yourimage.png" /></a>

我想您是在询问图像的alt属性。在某些浏览器中,当您将鼠标悬停在图像上时,会显示alt标记的内容,但并非在所有浏览器中都会显示

<img src="image.jpg alt="Some text here" />


如果您需要上下文帮助,那么您必须使用javascript来实现这一点,很抱歉,我无法提供示例。

我想您是在询问图像的alt属性。在某些浏览器中,当您将鼠标悬停在图像上时,会显示alt标记的内容,但并非在所有浏览器中都会显示

<img src="image.jpg alt="Some text here" />


如果您需要上下文帮助,则必须使用javascript来完成此任务,抱歉,我无法提供示例。

此问题有无数解决方案,您只需快速搜索即可获得所有解决方案。如果你仍然找不到你想要的答案,请澄清你的问题。这个问题有无数的解决方案,你只需快速搜索就可以找到。如果你仍然找不到你想要的答案,请澄清你的问题。