2017-02-18 41 views
0

例如,我有一段具有特定高度的段落。我想,超过这个高度变成省略号(...)的一切,而不是在画面切割的句子翻译成一半像: enter image description here文本溢出问题:椭圆在特定高度

我使用文本溢出尝试:椭圆,但它是没有用的。 请帮我这个。谢谢!

+1

的[垂直文本溢出可能用CSS3?]可能的复制(http://stackoverflow.com/questions/7004006/is-vertical-文本溢出可能与 - CSS3) – user6003859

回答

0

试试这个代码

div{display:block;width:300px;text-overflow:ellipsis;;overflow-y:scroll;max-height:200px; 
 

 
    display: -webkit-box; 
 
    -webkit-line-clamp: 7; 
 
    -webkit-box-orient: vertical; 
 
}
<div>this is text this is text this is textthis is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text</div>