答案 0 :(得分:0)
也许您可以共享一些代码(用Codepen或类似的东西),以便我可以看到结构。但是,这是我想实现的目标的摘要。 https://codepen.io/europarising/pen/xNJqVj
.categories {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-self: flex-start;
border: 2px solid red;
padding: 10px;
width: 1000px;
height: 300px;
overflow: hidden;
overflow-y: auto;
}
.categories__layer1 {
list-style: none;
padding: 0;
margin: 0 0 20px 0;
}
.categories .categories__layer1 > li {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-self: flex-start;
padding-right: 20px;
}
.categories .categories__layer1 > li span {
font-weight: bold;
}
.categories__layer2 {
display: flex;
flex-direction: column;
flex-wrap: wrap;
align-self: flex-start;
list-style: none;
padding: 0;
margin: 0 0 20px 0;
}