Overflow auto not working with justify-content: flex-end

后端 未结 3 1646
天命终不由人
天命终不由人 2020-12-07 02:44

I\'m trying to get an element to have items aligned to the right, and all overflowing elements to be hidden but accessed by scrollbar.

But it seems like the scrollba

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 03:03

    Here's how I would recommend you do it

    .row {
      width: 100%;
      max-width: 500px;
      background: #DADADA;
      flex: 1;
        display: flex;
        overflow: auto;
    }
    .box {
      display: flex;
      width: 200px;
      height: 40px;
      margin: 4px 10px;
      background: red;
      flex-shrink: 0;
    }

提交回复
热议问题