can I use flexbox and float at the same time? or u

2019-05-30 01:22发布

for example if I have a 2 column layout (main content and a aside) Can I float the main to the left and aside to left/right and then use flexbox to give the aside an equal height compared to the main content?

Do I have to display the whole container to flexbox to include header,main content, aside, and footer or can I just cherry pick one area to use flexbox?

1条回答
对你真心纯属浪费
2楼-- · 2019-05-30 02:02

From Overview,

Flex layout is superficially similar to block layout. It lacks many of the more complex text- or document-centric properties that can be used in block layout, such as floats

From Flex Containers,

float and clear have no effect on a flex item, and do not take it out-of-flow. However, the float property can still affect box generation by influencing the display property’s computed value.

From Absolutely-Positioned Flex Children,

An absolutely-positioned child of a flex container does not participate in flex layout. However, it does participate in the reordering step (see order), which has an effect in their painting order.

查看更多
登录 后发表回答