Tooltip on image

2019-01-22 00:32发布

I am using the tooltip. But I want that on image tag, like when I mouseover the image then the tooltip should work. I have tried but not working for me on image tag.

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-01-22 01:21

You can use the following format to generate a tooltip for an image.

<div class="tooltip"><img src="joe.jpg" />
  <span class="tooltiptext">Tooltip text</span>
</div>
查看更多
时光不老,我们不散
3楼-- · 2019-01-22 01:23

You can use the standard HTML title attribute of image for this:

<img src="source of image" alt="alternative text" title="this will be displayed as a tooltip"/>
查看更多
登录 后发表回答