I am using Bootstrap 3 and added a tooltip to my div. I've tried using < br > \n and 
 to create the new line. Would it be a problem with the Bootstrap stopping me?
<div class="content show-tooltip" data-placement="top" data-original-title="1st line of text <br> 2nd line of text">
Just use the entity code 
 for a linebreak in a title attribute.
How To Create a Tooltip. To create a tooltip, add the data-toggle="tooltip" attribute to an element. Note: Tooltips must be initialized with jQuery: select the specified element and call the tooltip() method.
You can use 
 or 
 .
You need to add data-html="true"
to the markup..
<div class="content show-tooltip" data-html="true" data-placement="top" title="1st line of text <br> 2nd line of text">
Working demo: https://codeply.com/p/C8083WXo5Z
In the Title use this code to break the line:
HTML
...title="- Item 1 
 - Item 2 
"
CSS
.ui-tooltip { /* tooltip container box */ white-space: pre-line; } .ui-tooltip-content { /* tooltip content */ white-space: pre-line; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With