【发布时间】:2016-01-14 21:17:24
【问题描述】:
假设我有一个固定高度的行,我在它的列中插入了一些文本。如果它太长,我想将其切断,并在行尾添加三个点,如下所示:
我在我的行中为此使用 text-overflow: ellipsis; 属性,但无法使其正常工作。
我做错了什么?
HTML
<div class="container">
<div class="row text">
<div class="col-xs-4" style="border: solid">
Some really long text! Some really long text! Some really long text! Some really long text! The end! Some really long text! The end! Some really long text! The end! Some really long text! The end!
</div>
</div>
</div>
CSS
.row {
margin: 2px 0;
}
.text {
word-wrap: break-word;
height: 50px;
text-overflow: ellipsis;
}
【问题讨论】:
标签: twitter-bootstrap css twitter-bootstrap-3 overflow