在光标下显示文本 [英] Display text under cursor
问题描述
添加 title
属性。这是在上面的图像中完成的。
< a class =vote-up-offtitle =This answer is有用。>投票< / a>
如果您想要自定义工具提示,请参阅这个答案。您基本上会使用伪元素和自定义 data - *
属性的组合。为了访问<$ c c> attr(data-tooltip),你会给伪元素一个 content
值例如$ c> data-tooltip
属性。
Whe mouse pointer placed on an element I want to show some text. For example if you place your cursor on upvote of an answer, it shows "This answer is useful". You can see it in below image. I did't even know how to search this.
Add a title
attribute to the element. That's what's done in the image above.
<a class="vote-up-off" title="This answer is useful.">up vote</a>
If you want a custom tooltip, see this answer. You would basically use a combination of pseudo elements and custom data-*
attributes. You would give the pseudo elements a content
value of attr(data-tooltip)
in order to access the data-tooltip
attribute, for instance.
这篇关于在光标下显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!