Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add line break within tooltips

People also ask

How do I put a line break in bootstrap tooltip?

Solution 1 Yes - ToolTips obey "\r\n" characters and start on a new line. myObject. ToolTip = "Line 1\r\nLine 2\r\nLine 3"; will work fine.

How do I add a tag in tooltip?

Via data attributes − To add a tooltip, add data-toggle = "tooltip" to an anchor tag. The title of the anchor will be the text of a tooltip. By default, tooltip is set to top by the plugin.

Can we add link in tooltip?

Tooltips can contain hyperlinks. You can use HTML tags to format the text in tooltips. The <href> and </href> tags allow you to insert a hyperlink.


Just use the entity code &#013; for a linebreak in a title attribute.


Just add a data attribute

data-html="true"

and you're good to go.

Eg. usage:

<i data-html="true" class="tooltip ficon-help-icon" twipsy-content-set="true" data-original-title= "<b>Hello</b> Stackoverflow"> </i>

It has worked in majority of the tooltip plugins i have tried as of now.


The &#013; combined with the style white-space: pre-line; worked for me.


This CSS is what finally worked for me in conjunction with a linefeed in my editor:

.tooltip-inner {
    white-space: pre-wrap;
}

Found here: How to make Twitter bootstrap tooltips have multiple lines?


\n

with the styling

.tooltip-inner {
    white-space: pre-line;
}

worked for me.