Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 使用纯css在鼠标悬停时显示Div或工具提示_Jquery_Css - Fatal编程技术网

Jquery 使用纯css在鼠标悬停时显示Div或工具提示

Jquery 使用纯css在鼠标悬停时显示Div或工具提示,jquery,css,Jquery,Css,我有这个图像。我想要的是,当用户将鼠标悬停在灰色区域上时,显示有关灰色区域的信息。我希望信息以div格式显示 有没有一种纯粹的CSS方法可以做到这一点 可以使用具有标题属性的图像贴图来保存鼠标悬停工具提示。 像这样: <img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap"> <map name="planetmap"> <area shape="rect

我有这个图像。我想要的是,当用户将鼠标悬停在灰色区域上时,显示有关灰色区域的信息。我希望信息以div格式显示


有没有一种纯粹的CSS方法可以做到这一点

可以使用具有标题属性的图像贴图来保存鼠标悬停工具提示。 像这样:

<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm" title="sun">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm" title="mercury">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm" "title="venus">
</map>


测试。只需将标题属性添加到代码中。

您可以在Photoshop中对图像进行切片并指定每个部分。您最终做了什么?然后您将需要javascript来完成此操作。您可以查看jQuery UI中的工具提示示例: