Flexbox在Safari中不起作用,在Web检查器中被删除

时间:2014-11-27 09:41:29

标签: css safari flexbox safari-web-inspector

我正在使用display: flexbox为一个div容器组合一些正方形(以使它们水平对齐),它在Chrome中工作正常,但在Safari 8.0中没有,它在这里被删除了:

enter image description here

#grid {
    overflow-x: hidden;
    overflow-y: scroll;

    position: absolute;
    top: 55px;
    left: 415px;
    bottom: 10px;
    right: 10px;

    display: flex;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: wrap;
}

.square {
    width: 166px;
    height: 185px;
    position: relative;
    cursor: pointer;
    background-size: 166px 125px !important;
    background-repeat: no-repeat !important;
    background: #FFF;
    margin-right: 20px;
    float: left;
}

1 个答案:

答案 0 :(得分:3)

你需要使用前缀,所以safari支持

#grid {
    overflow-x: hidden;
    overflow-y: scroll;
    position: absolute;
    top: 55px;
    left: 415px;
    bottom: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: wrap;
    display: -webkit-flex;
    -webkit-justify-content: space-between;
    -webkit-flex-direction: row;
    -webkit-flex-wrap: wrap;
}