段落只显示2行 和flex结构

 1 .text-top{
 2   font-family: MicrosoftYaHei;
 3   font-size: 0.24rem;
 4   line-height: 0.4rem;
 5   letter-spacing: 0.01rem;
 6   color: #666;
 7   overflow: hidden;
 8   text-overflow: ellipsis;
 9   display: -webkit-box;
10   -webkit-line-clamp: 2;
11   -webkit-box-orient: vertical;
12   margin-bottom: .3rem;
13 }
14 .showall {
15   -webkit-line-clamp:inherit;
16 }
1 /*主要的代码:*/ 
2 overflow: hidden;
3 text-overflow: ellipsis;
4 display: -webkit-box;
5 -webkit-line-clamp: 2;
6 -webkit-box-orient: vertical;
1 display: flex;
2  flex-direction: column;
3  width: 4rem;
4  justify-content: flex-end;display: flex;
5       

 

posted @ 2020-08-28 10:55  鸿兮萄  阅读(527)  评论(0编辑  收藏  举报