-moz-column-fill:在Firefox中自动中断CSS列

DKr*_*ion 3 css firefox css3 responsive-design

我试图将我的设计分为三列.在Chrome中它运行得很好,但在Firefox中它只显示一列而不是三列.

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;
}
Run Code Online (Sandbox Code Playgroud)
<div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>
Run Code Online (Sandbox Code Playgroud)

agr*_*grm 6

删除整个-moz-column-fill: auto规则,或将其更改为-moz-column-fill: balance(默认初始值)

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;
}
Run Code Online (Sandbox Code Playgroud)
<div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>
Run Code Online (Sandbox Code Playgroud)

话虽这么说,column-fill仍然只是一个候选推荐标准,所以期望浏览器行为改变.