简体   繁体   English

如何重复增加div(顶部div和底部div)动态增加

[英]How to make dynamic increasing of divs (div at the top and div at the bottom) repeatedly

If we consider we have a wrapper div that has unknown number of tabs. 如果我们考虑,我们有一个包装div,其中的标签数量未知。

<div class="wrapper">
    <div> Tab1 </div>
    <div> Tab2 </div>
    <div> Tab3 </div>
    <div> Tab4 </div>
    <div> Tab5 </div>
    <div> Tab6 </div>
    <div> Tab7 </div>
    <div> Tab1 </div>
    <div> Tab1 </div>
</div>

How to dynamically increase Tabs Div? 如何动态增加Tabs Div? I want the arrangement to be like Div up, Div down then Div up, Div down etc… 我希望安排像Div up,Div down然后Div up,Div down等…
Like on the image below. 就像下面的图片一样。

格网

The Solution was in the CSS By the Following Code: 该解决方案位于CSS中,代码如下:

div {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM