prevent wrapping lines in flexbox child element

前端 未结 1 676
长发绾君心
长发绾君心 2021-01-31 15:03

How do I prevent line wrapping of a flexbox element? Is it even possible?

I\'m attempting to create a two column grid with flexbox with the following markup:

<         


        
1条回答
  •  孤独总比滥情好
    2021-01-31 15:38

    The property you are looking for is flex-shrink, not flex-basis.

    .no-wrap{
      flex-shrink: 0;
    }
    

    Note however, that IE10 is not listed as supporting this property (as it did not exist in the specification at the time they added the Flexbox implementation). You can use the flex property instead.

    .no-wrap{
      flex: 0 0 auto; 
    }
    

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