引导模式

时间:2017-09-04 07:25:25

标签: css twitter-bootstrap twitter-bootstrap-3 modal-dialog

我想要获得的是Bootstrap模态体中非常长的文本内容,如果长度超过模态宽度,则放在一行上并以省略号结束。

<div class="modal-body">
    <span>Some very very very long text in the modal.</span>
</div>

2 个答案:

答案 0 :(得分:0)

尝试:

<强> CSS

.ellipsis {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

<强> HTML

<div class="modal-body">
  <div class="ellipsis">Some very very very long text in the modal.Some very very very long text in the modal.Some very very very long text in the modal.Some very very very long text in the modal.</div>
</div>

演示:http://jsfiddle.net/lotusgodkk/GCu2D/2084/

答案 1 :(得分:0)

对于引导程序4,现在有text-truncate类将执行相同的操作。

<h3 class="text-truncate">Name</h3>