2017-09-04 45 views
0

我想获得的是Bootstrap模式主体中的非常长的文本内容,放置在单行上,如果长度超过模式宽度,则以省略号结束。引导模式中的文本溢出省略号

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

回答

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/