包装整个单词,其中包含连字符(如12-02-2018),但不包装部分单词
像12-02-
2018
<div class="modal-body">
<p>Test test Test test Test test Test test 12-02-2018</p>
</div>
答案 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>