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>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With