Ignore flex container children but not grandchildren

前端 未结 2 813
滥情空心
滥情空心 2020-12-22 04:01

I have a simple flex element with some children, something like this:

2条回答
  •  情话喂你
    2020-12-22 04:33

    If the element is a child of a flex container, then it becomes a flex item. That's the general rule.

    However, most browsers will ignore that rule when the child is absolutely positioned.

    I'm not sure that's a useful solution in this case, but that's what you would have to do: absolutely position .subcontainer and make it flex container, so that the children become flex items.

提交回复
热议问题