在代码包围文本上悬停文本 [英] Hover Text on code surrounded text

查看:24
本文介绍了在代码包围文本上悬停文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在寻找一种方法,当鼠标悬停在网站内任何位置的几个词上时,信息文本就会显示出来.我看到有一些插件可以处理这个问题,但它们似乎对站点管理员创建的自定义内容类型没有任何作用.此外,它们不适用于我希望成为词汇表术语的文本周围的特定 html 标签.

Was looking for a way for informational text to show up once the mouse hovers over a few words anywhere within the website. I see that there are some plugins that handle this but they dont seem to do anything witin custom content types created by the site admin. In addition, tey dont sem to work for specific html tags surrounding the text I wish to be a glossary term.

例如,假设我在两个列表标签之间有选项 1"字样 (li) 我希望它在有人将鼠标悬停时读取这是文本"出现在无序列表中的选项 1".换句话说,我特别希望它适用于出现在 (li) 标签中的所有选项 1"实例

For example, lets say I have the words "Option 1" between two list tags (li) I would want it to read "Here is text" upon someone mousing over "Option 1" which appears in an unordered list.In other words, I specifically want it to work for all instances of "Option 1" that appear enclosed within (li) tags

这个要求是不是太过分了?也许有一种不同的方法可以完全做到这一点.我只是希望人们能够从复选框中选择选项,但有一种方法可以从列出这些选项的页面详细查看这些选项的内容.工具提示似乎适用于词汇表条目,所以我想也许也可以这样做.

Is this request too far fetched? Maybe there is a different way to do this entirely. I just want people to be able ot select options from a checkbox, but have a way to see what those options are in detail from that page where they are listed. Tooltips seem to work well for glossary entries so I figured maybe the same could be done.

似乎没有设置大多数工具提示插件来代替 WordPress 自定义内容类型.

Seems that most of the tooltip plugins are not setup in lieu of WordPress Custom Content Types.

推荐答案

最简单的方法就是简单地添加title属性,就像制作一个如下所示的列表标签:

The simplest way is simply to add the title attribute, like to make a list tag that looks like this:

<li title="Here is text">
    Option 1
</li>

当然,这个,你不能设置样式或修改 - 它完全由浏览器解释.或者,您可以查看创建您的自己的 工具提示,使用 Javascript 或 CSS3.

Of course, this, you can't style, or modify - it's entirely interpreted by the browser. Alternatively, you could look into creating your own tooltips, using Javascript or CSS3.

这篇关于在代码包围文本上悬停文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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