-moz-column-fill: auto breaks CSS columns in Firefox

前端 未结 1 1353
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-11 19:16

I am trying to divide my design into three columns. In Chrome it is working perfectly, but in Firefox it is showing only one column instead of three.

相关标签:
1条回答
  • 2020-12-11 19:46

    Either remove the whole -moz-column-fill: auto rule, or change it to -moz-column-fill: balance (The default initial value)

    body > div {
      -moz-column-count: 3;
      -moz-column-gap: 10px;
      /*-moz-column-fill: auto;*/
      -webkit-column-count: 3;
      -webkit-column-gap: 10px;
      -webkit-column-fill: auto;
      column-count: 3;
      column-gap: 15px;
      column-fill: auto;
    }
    body > div > div {
      background: #F00;
      height: 400px;
    }
    body > div > div:nth-child(2n) {
      background: #FF0;
    }
    <div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>

    That being said, column-fill is still only a Candidate Recommendation, so expect browser behaviour to change.

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