像我们悬停在用户的声誉上一样,添加没有JavaScript的悬停文本 [英] Add hover text without javascript like we hover on a user's reputation

查看:64
本文介绍了像我们悬停在用户的声誉上一样,添加没有JavaScript的悬停文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在stackoverflow中,当我们悬停在用户的名声上时,我们看到了一段文字。我在很多地方看到过这个,源代码告诉我可以在没有js的情况下完成。

 < div =text>悬停我< / div> 


解决方案

使用 title 属性。

 < div title =text>悬停我< / div> 

 < span title =hoverin'words> hover me< / span> 


In stackoverflow, when we hover on a user's reputation we see a text. I have seen this at many places and the source code tells me that it can be done without js. And i tried and got only this-

 <div="text">hover me</div>

解决方案

Use the title attribute.

<div title="text">hover me</div>

or

<span title="hoverin' words">hover me</span>

这篇关于像我们悬停在用户的声誉上一样,添加没有JavaScript的悬停文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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