我可以在 Twitter Bootstrap 的工具提示中使用复杂的 HTML 吗? [英] Can I use complex HTML with Twitter Bootstrap's Tooltip?

查看:19
本文介绍了我可以在 Twitter Bootstrap 的工具提示中使用复杂的 HTML 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我查看官方文档,我可以看到一个名为 HTML 的属性:

If I check official documentation, I can see a property called HTML:

Name    |    Type       |    default  |    Description
----------------------------------------------------------------------------
html    |    boolean    |    false    |    Insert html into the tooltip. 
                                           If false, jquery's text method 
                                           will be used to insert content 
                                           into the dom. Use text if you're 
                                           worried about XSS attacks.

它说,将 html 插入工具提示",但类型是布尔值.如何在工具提示中使用复杂的 html?

It says, "insert html into the tooltip", but the type is boolean. How can I use complex html inside a Tooltip?

推荐答案

这个参数只是关于你是否打算在工具提示中使用复杂的 html.将其设置为 true,然后将 html 输入到标签的 title 属性中.

This parameter is just about whether you are going to use complex html into the tooltip. Set it to true and then hit the html into the title attribute of the tag.

看到这个小提琴 这里 - 我已经通过 将 html 属性设置为 truedata-html="true"<a> 标签中,然后作为示例添加到 html ad hoc 中.

See this fiddle here - I've set the html attribute to true through the data-html="true" in the <a> tag and then just added in the html ad hoc as an example.

这篇关于我可以在 Twitter Bootstrap 的工具提示中使用复杂的 HTML 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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