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

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

问题描述

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

 名称|类型|默认|说明
--------------------------------------------- -------------------------------
html |布尔| false |将html插入到工具提示中。
如果为false,则将使用jquery的文本方法
将内容
插入到dom中。如果您是
担心XSS攻击,请使用文本。

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

解决方案

这个参数就是关于是否要使用复杂的html提示。将它设置为 true ,然后将html打到标签的 title 属性中。



请参阅此小提琴此处 - 我已将html属性设置为true通过< a> 标记中的 data-html =true,然后添加到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.

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

解决方案

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.

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天全站免登陆