.warp {
column-count: 2;
column-gap: 10px;
padding: 5px;
}
.item {
height: 80px;
margin-bottom: 10px;
break-inside: avoid;
}
效果如下

本文介绍了一种使用CSS的列布局技巧,通过column-count属性实现多列布局,并利用break-inside属性确保内容不会在列内断开,同时设置了列间隙和内边距。
.warp {
column-count: 2;
column-gap: 10px;
padding: 5px;
}
.item {
height: 80px;
margin-bottom: 10px;
break-inside: avoid;
}
效果如下


被折叠的 条评论
为什么被折叠?