【问题标题】:Force One Line Break in Bootstrap Tooltip [duplicate]在引导工具提示中强制换行 [重复]
【发布时间】:2013-07-10 10:30:03
【问题描述】:

我有一个 'li' 项目,其中包含一个弹出引导工具提示的标签。

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

如何在“that”和“will”之间强制换行?我不想使用工具提示的() {html : true} 选项来避免 XSS 攻击的风险。

【问题讨论】:

  • 不同的问题。我不想对整个 div 应用换行,我只想插入一个单数换行符。
  • 该问题的第一个答案使工具提示尊重新行。如果你插入一个单数换行符,这就是你将得到的。

标签: html css twitter-bootstrap tooltip line-breaks


【解决方案1】:

我找到的不错的答案,使用上面的半重复,是将 CSS 设置为:

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

【讨论】:

    猜你喜欢
    • 2020-09-04
    • 1970-01-01
    • 2013-06-19
    • 2019-03-17
    • 1970-01-01
    • 2014-01-20
    • 1970-01-01
    • 1970-01-01
    • 2016-11-05
    相关资源
    最近更新 更多