Bootstrap在文本中包含连字符后将整个单词包装起来

时间:2018-10-04 11:56:12

标签: twitter-bootstrap

包装整个单词,其中包含连字符(如12-02-2018),但不包装部分单词       像12-02-
            2018

<div class="modal-body">
  <p>Test test Test test Test test Test test 12-02-2018</p>
</div>

1 个答案:

答案 0 :(得分:0)

使用额外的跨度,像这样:

<div class="modal-body">
  <p>Test test Test test Test test Test test <span class="text-nowrap">12-02-2018</span></p>
</div>

等于

    <div class="modal-body">
      <p>Test test Test test Test test Test test <span style="white-space: nowrap">12-02-2018</span></p>
    </div>