twitter-bootstrap 在 Bootstrap 工具提示中强制换行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17605450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Force One Line Break in Bootstrap Tooltip
提问by user1114864
I have a 'li' item that contains a label which pops up a Bootstrap tooltip.
我有一个“li”项目,其中包含一个弹出 Bootstrap 工具提示的标签。
<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.
如何强制在“that”和“will”之间换行?我不想使用工具提示的(){html : true}选项来应对 XSS 攻击的风险。
回答by user1114864
Decent answer I found, using the semi-duplicate above, is to set the CSS as:
我找到的体面答案,使用上面的半重复,是将 CSS 设置为:
.tooltip-inner {
white-space: pre-wrap;
min-width: 100px;
}

