本文介绍了如何在css中显示有限的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在HTML中有这样的文字:
I have text like this in HTML:
<p>text texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext texttext text</p>
是否可以这样:
text texttext texttext texttext text.....
推荐答案
在CSS样式下为<p>
标签应用.
Apply below CSS style for <p>
tag.
p{
width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
这篇关于如何在css中显示有限的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!