Nested flexboxes works differently across browsers

后端 未结 4 650
[愿得一人]
[愿得一人] 2020-12-14 07:14

I have a small example of a nested flexbox setup: http://jsfiddle.net/ThomasSpiessens/MUrPj/12/

In this example the following applies:

  • CSS \'box\' cl
4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 07:57

    I've found a solution without removing the extra-div.

    You need to make boxContent relative positioned and its containing box absolute.

    With attaching an extra css class to the inner div:

    and following css:

    .boxContent {
      ...
        position: relative;
    }
    .innerBox{
        position: absolute;
        top: 0px;
        bottom: 0px;
    }
    

    here's the updated jsfiddle: http://jsfiddle.net/MUrPj/223/

    This question is pretty old, but this might be helpful for future visitors

提交回复
热议问题