Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

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>
like image 406
DKreation Avatar asked Jun 13 '14 19:06

DKreation


1 Answers

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.

like image 97
agrm Avatar answered Oct 06 '22 11:10

agrm