can I use flexbox and float at the same time? or use flexbox with absolute positioning?

醉酒当歌 提交于 2019-12-23 01:19:11

问题


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:


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.



来源:https://stackoverflow.com/questions/31953105/can-i-use-flexbox-and-float-at-the-same-time-or-use-flexbox-with-absolute-posit

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