Flex项目未包装在Firefox中

时间:2014-03-19 08:34:00

标签: html css css3 flexbox

我在这样的flex div中有一个div列表 Chrome

enter image description here

但是在 Firefox 中,它仅使用一行进行水平滚动

enter image description here

如果不强制水平滚动,我该怎么办?我想在Firefox中像Chrome一样

#maindiv{
    margin: auto;
    width: 97%;
    border: 1px solid #F4F4F4;
    border-radius: 2px;
    margin-top: 10px;
    -webkit-justify-content: space-around;
    -webkit-flex-wrap: wrap;
    -moz-justify-content: space-around;
    -moz-flex-wrap: wrap;
    -ms-justify-content: space-around;
    -ms-flex-wrap: wrap;
    justify-content: space-around;
    flex-wrap: wrap;
    display: -webkit-flex;
    display: flex;
    display: -moz-box;
    -moz-box-pack: center;
    -moz-box-align: center;
    height: 395px;
    max-height: 395px;
    overflow-y: scroll;
}

#divslist{
    list-style: none;
    margin: 0px;
    float: left;
    position: relative;
    zoom: 1;
    -webkit-justify-content: space-around;
    -webkit-flex-wrap: wrap;
    -moz-justify-content: space-around;
    -moz-flex-wrap: wrap;
    -ms-justify-content: space-around;
    -ms-flex-wrap: wrap;
    justify-content: space-around;
    flex-wrap: wrap;
    display: -webkit-flex;
    display: flex;
    display: -moz-box;
    -moz-box-pack: center;
    -moz-box-align: end;
}

1 个答案:

答案 0 :(得分:2)

刚刚从

更改了css中的顺序
display: -webkit-flex;
display: flex;
display: -moz-box;

display: -webkit-flex;
display: -moz-box;
display: flex;

并在FF中工作。在FF和chrome中检查此fiddle