如何做引导技巧性的工具提示多行 [英] how to do bootstrap tipsy tooltip multiline

查看:148
本文介绍了如何做引导技巧性的工具提示多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如标题中所示,如何将工具提示分为两行?

as in title, how can I split in two lines the tooltip?

我也会使用一些html标记(例如span或p).

I would use some html tag (like span or p) too.

我已经尝试了html实体,它不起作用. Some<br> text

I already tried html entities, it doesn't work. Some<br> text

推荐答案

切换工具提示的html元素必须具有值为true

The html element that toggles the tooltip must have a data-html attribute with value true

示例:

<button type="button"
        class="btn btn-default"
        data-toggle="tooltip"
        data-html="true"
        data-placement="right"
        title="Tooltip on right">Tooltip on right</button>

data-html="true"将在工具提示中插入HTML. 如果为false,则将使用jQuery的text方法将内容插入DOM. 如果您担心XSS攻击,请使用文字.

The data-html="true" will 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.

添加此属性后,您可以使用<div></div><p></p>之类的块元素将工具提示内容分成多行.

After you add this attribute you may split the tooltip content into multiple lines by using a block element like a <div></div> or <p></p>.

我想您也可以在两行之间添加一个换行符:<br>

I suppose you could also add a line break between the lines: <br>

文档此处. //检查选项"表.

Documentation here. // Check the Options table.

这篇关于如何做引导技巧性的工具提示多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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