文本折叠

布局的原则:先分大块,再分小块,先横再竖
文本折叠:
单行折叠:
/去掉原点修饰符/
list-style-type: none;
/不折行/
white-space: nowrap;
/超出部分隐藏/
overflow:hidden;
/超出的部分用省略号显示/
text-overflow: ellipsis;

多行折叠:
display: -webkit-box;
-webkit-box-orient: vertical;

-webkit-line-clamp: 2;

overflow:hidden;
text-overflow: ellipsis;

垂直居中:
单行文本:
height:400px
line-height:400px

多行文本:
固定高度:
display: flex;
垂直居中:align-items: center;
不固定高度:
padding-top: 150px;
padding-bottom: 150px;

posted @ 2026-07-09 18:21  唐硕  阅读(1)  评论(0)    收藏  举报