<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>Document</title>
<style>
. comment_inner{
width:200px;
word-break:break-all;
text-overflow:ellipsis;
display:-webkit-box; the/** object is displayed as a telescopic box model **/
-webkit-box-orient:vertical; /** Sets or retrieves the arrangement of child elements of a telescopic box object **/
-webkit-line-clamp:3; /** the number of rows displayed **/
overflow:hidden; /** hide out of content **/
}
</style>
<body>
<div>
<p>
The Word-break property specifies how the Wrap is Handled. Normal (use the Browser's default line-wrapping rule.) ), Break-all (allows Line wrapping within a word.) ), Keep-all (can only wrap at half-width spaces or hyphens.) )
</p>
</div>
</body>
Generally used in a row.
1.overflow:hidden;
2.text-overflow:ellipsis;
3.-o-text-overflow:ellipsis;
4.white-space:nowrap;
5.width:100%;
Among them, Overflow:hidden and White-space:nowrap are necessary, otherwise the ellipsis will not be displayed;-o-text-overflow:ellipsis is for opera, and the width is set mainly for IE6;
This method supports Internet Explorer, Safari, Chrome, and Opera, but FF does not support it, but it can be done with jquery for similar effects.
CSS text shows the remaining ellipses in two lines