How to exclude the first item in a flexbox wrap?

前端 未结 1 1728
無奈伤痛
無奈伤痛 2020-11-30 04:01

Is there a way to exclude the first item in a flex wrap other than reorder the markup?

a
相关标签:
1条回答
  • 2020-11-30 04:46

    Is there a way to exclude the first item in a flex wrap other than reorder the markup?

    After some initial confusion we now understand that what is actually required is for the content to wrap after the first div.

    Obviously, the simplest method to achieve this is for the first div to be 100% wide of the parent.

    .view-container .view-content {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
    }
    .filterbox {
      flex: 0 0 100%;
    }
    <div class="view-container">
      <div class="view-content">
        <div class="filterbox">FILTER</div>
        <div class="flex-item">
          Flex-ITEM
        </div>
        <div class="flex-item">
          Flex-ITEM
        </div>
        <div class="flex-item">
          Flex-ITEM
        </div>
      </div>
    </div>

    0 讨论(0)
提交回复
热议问题