Force One Line Break in Bootstrap Tooltip [duplica

2019-06-14 11:13发布

问题:

This question already has an answer here:

  • How to make Twitter bootstrap tooltips have multiple lines? 6 answers

I have a 'li' item that contains a label which pops up a Bootstrap tooltip.

<label class="radio dropClick centTooltip" data-toggle="tooltip" data-placement="right" title="Here are some words that will show up in the tooltip">
    <input type="radio" class="centTooltip" name="cents" id="optionsRadios2" value="AA">
    Hover for ToolTip! 
</label>

How do I force one line break between 'that' and 'will'? I don't want to use the tooltip's() {html : true} option for risk of XSS attacks.

回答1:

Decent answer I found, using the semi-duplicate above, is to set the CSS as:

.tooltip-inner {
    white-space: pre-wrap;
    min-width: 100px;
}