如何通过点(...)减少段落的长度? [英] How to reduce the length of the paragraph by dots(...)?
本文介绍了如何通过点(...)减少段落的长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个p标签,
<p> best villan in the film industry</p>
我必须在8个字符后剪切句子,
like
i have to cut the sentence after 8 characters, but after that dots should appear. like
best vil...
如何使用css?
如果可能通过angular js也赞赏
How to make it using css? If its possible by angular js also appreciated
推荐答案
为此你可以使用text-overflow:ellipsis;属性。写这样
For this you can use text-overflow: ellipsis; property. Write like this
#content_right_head span{
display:inline-block;
width:180px;
white-space: nowrap;
overflow:hidden !important;
text-overflow: ellipsis;
}
检查此 http://jsfiddle.net/Y5vpb/
这篇关于如何通过点(...)减少段落的长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文