text abbreviated text beyond display ellipsis controls the number of lines beyond omitting

text abbreviation


.abb{
    
    
	//超出一行省略
	overflow:hidden; 
	white-space:nowrap; 
	text-overflow:ellipsis;
}

Over 2 lines omitted

.abb2{
    
    
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  //超出2行省略
  -webkit-line-clamp:2;
  overflow: hidden;
}

Controls beyond the number of lines omitted

.txt-over{
    
    
	/*控制超出省略的行数*/
	word-break: break-all;
    text-overflow: ellipsis;
    display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
    -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
    -webkit-line-clamp: 2; /** 显示的行数 **/
    overflow: hidden;
}

Guess you like

Origin blog.csdn.net/maoge_666/article/details/131917259