Skip to content Skip to sidebar Skip to footer

Safari 6 (ios 6) Flex Layout Doesn't Wrap Elements

I need the two boxes to be in columns. This works in other browsers I have tested but not in Safari 6 on iOS 6. Example: http://jsfiddle.net/5FESj/1/ display: -webkit-box; -webkit-

Solution 1:

Demo

HTML

<divclass="page-wrap"><divclass="content1"><h1>DIV 1</h1></div><divclass="content2"><h2>DIV 2</h2></div></div>

CSS

.page-wrap > div {
    width: 100%;
    height: 100px;
    background-color: lightBlue;
    border: 1px solid black;
}
.page-wrap {
    display: -webkit-box;
    /* OLD - iOS 6-, Safari 3.1-6 */display: -moz-box;
    /* OLD - Firefox 19- (doesn't work very well) */display: -ms-flexbox;
    /* TWEENER - IE 10 */display: -webkit-flex;
    /* NEW - Chrome */display: flex;
    /* NEW, Spec - Opera 12.1, Firefox 20+ */
}
.content1 {
    -webkit-box-ordinal-group: 1;
    /* OLD - iOS 6-, Safari 3.1-6 */
    -moz-box-ordinal-group: 1;
    /* OLD - Firefox 19- */
    -ms-flex-order: 1;
    /* TWEENER - IE 10 */
    -webkit-order: 1;
    /* NEW - Chrome */order: 1;
    /* NEW, Spec - Opera 12.1, Firefox 20+ */min-width:200px;
    width: 50%;
    /* No flex here, other cols take up remaining space */
    -moz-box-flex: 1;
    /* Without this, Firefox 19- expands to widest paragraph, overrides width */
}
.content2 {
    -webkit-box-ordinal-group: 2;
    /* OLD - iOS 6-, Safari 3.1-6 */
    -moz-box-ordinal-group: 2;
    /* OLD - Firefox 19- */
    -ms-flex-order: 2;
    /* TWEENER - IE 10 */
    -webkit-order: 2;
    /* NEW - Chrome */order: 2;
    /* NEW, Spec - Opera 12.1, Firefox 20+ */
    -webkit-box-flex: 2;
    /* OLD - iOS 6-, Safari 3.1-6 */
    -moz-box-flex: 2;
    /* Firefox 19- *//* For OLD syntax, otherwise collapses. */min-width:200px;
    -ms-flex: 2;
    /* TWEENER - IE 10 */
    -webkit-flex: 2;
    /* NEW - Chrome */flex: 2;
    /* NEW, Spec - Opera 12.1, Firefox 20+ */background: #ccc;
}

@media screen and (max-width: 500px) {
    .page-wrap {
        display: block;
    }
}

References : (1) (2)

Demo

css

@media screen and (max-width: 500px) {
    .page-wrap {
        flex-direction: column-reverse;
    }
}

Refer

Post a Comment for "Safari 6 (ios 6) Flex Layout Doesn't Wrap Elements"