css flexbox wrap property doesn't work on ios6

末鹿安然 提交于 2019-12-24 00:13:54

问题


I am working on my project now, so I decided to use flexbox instead of float. It works fine for me, but I've found that display:flex doesn't work on the old iphone (ios 6.1). So I've added

display: -webkit-box;

Flex property works now, but all items are arranged in a row. I've created a simple fiddle, to show the problem. Also I've made two screenshots, to show how it works on PC and on iPhone.

PC:

iPhone:

As you see -webkit-flex-wrap: wrap doesn't work.

Does anybody know how to solve this problem?? I hope for your help.


回答1:


Support for the current flexbox specification in iOS doesn't begin until iOS 7.0.

iOS 3.2 - 6.1 support the old flexbox specification and do not support wrapping.

See browser support data here: http://caniuse.com/#search=flexbox




回答2:


See the flex-direction property for info on how to align the flex items (row or column).

.wrapper {
    flex-direction: column;
    ...
}

Also, on your flex items, you have (width: 500px;) try the flex property:

.wrapper > div {
   flex: 0 0 500px;
   ...
}


来源:https://stackoverflow.com/questions/33197129/css-flexbox-wrap-property-doesnt-work-on-ios6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!