how to do bootstrap tipsy tooltip multiline

有些话、适合烂在心里 提交于 2020-01-01 15:45:48

问题


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

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

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


回答1:


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

Example:

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

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.

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>.

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

Documentation here. // Check the Options table.



来源:https://stackoverflow.com/questions/23848487/how-to-do-bootstrap-tipsy-tooltip-multiline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!