Overlapping CSS flexbox items in Safari

前端 未结 2 856
一个人的身影
一个人的身影 2020-12-05 01:54

What\'s the correct CSS to force Safari to not overlap flex items within a default flex container?

Safari seems to give too much width to flex items with lots of con

相关标签:
2条回答
  • 2020-12-05 02:52

    I also had a similar issue where flex box direction changed to column overlapped items on iPad. The issue was with the flex: 0 1 0; property applied to child element. Give the base value auto. flex: 0 1 auto;

    .parent{
        display: flex;
        flex-direction: column;
    }
    .parent .child{
        flex: 0 1 auto;
    }
    
    0 讨论(0)
  • 2020-12-05 02:55

    The element is shrinking. You need to set the flex-shrink property to 0 on the shrinking element.

    main >div:first-child {
      -webkit-flex: 0;
      flex-shrink: 0;
    }
    
    0 讨论(0)
提交回复
热议问题