我想将text-overflow:ellipsis
提供给我的span标记。
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="input-group date event_box" style="width: 100%;">
<span class="form-control event_rearrange" style="overflow: hidden; text-overflow: ellipsis; word-wrap: normal;"> Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text</span>
<span class="input-group-addon" style="background:#000000;" >
<span class="glyphicon glyphicon-pencil " style="color: #FFFFFF;"></span>
</span>
</div>
我得到的输出是result that i get
我不想增加width
。
任何帮助都会很棒。
谢谢。答案 0 :(得分:1)
在Css中添加一些自定义width
和使用display: inline-flex;
代码段示例
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="input-group date event_box" style="width: 100%;display: inline-flex;">
<span class="form-control event_rearrange" style=" overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;"> Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text Some Text</span>
<span class="input-group-addon" style="background:#000000;min-width: 42px;" >
<span class="glyphicon glyphicon-pencil " style="color: #FFFFFF;"></span>
</span>
</div>
&#13;
答案 1 :(得分:0)
.ellipsis { text-: ellipsis; }
<p class=" ellipsis">This is an example text showing nothing interesting but the truncated content via text- shorthand property.</p>
您可以查看以下链接: - https://css-tricks.com/almanac/properties/t/text-overflow/
text-overflow:ellipsis;
仅在满足以下条件时才有效:
&安培;试试这个链接: - CSS text-overflow: ellipsis; not working?