Cross Browser support for CSS Flexbox

后端 未结 5 509
北海茫月
北海茫月 2020-12-09 18:35

I have been using the code mentioned below, it works on my Chrome but not on my IE9 and Safari.

I googled for the solution, despite I got various vendor prefixes, th

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 18:50

    My Flexbox css: I have tested on serveral devices from Android 2.3.3 and IOS and works ok:

    .flex-container {
            display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
            display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
            display: -ms-flexbox;      /* TWEENER - IE 10 */
            display: -webkit-flex;     /* NEW - Chrome */
            display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */
            width: 100%;
    
    }
    
    .item {
            -webkit-box-flex: 1;      /* OLD - iOS 6-, Safari 3.1-6 */
            -moz-box-flex: 1;         /* OLD - Firefox 19- */
            -webkit-flex: 1;          /* Chrome */
            -ms-flex: 1;              /* IE 10 */
            flex: 1;                  /* NEW, Spec - Opera 12.1, Firefox 20+ */
    }
    

提交回复
热议问题