平平淡淡开开心心  
微信小程序全栈交流群 全球旅游旅行交流群

容器的概念,是用来包含其它容器(container)和项目(item)。

flex container——flex容器

A flexbox layout is defined using the flex or inline-flex values of the display property on the parent item. This element then becomes a flex container, and each one of its children becomes a flex item.

给view(在小程序中用view,h5里用div)的display属性设置为flex或inline-flex,这个view就成了flex容器,view里的元素就成了flex item。

 

A value of flex causes the element to become a block level flex container, and inline-flex an inline level flex container. These values create a flex formatting context for the element, which is similar to a block formatting context in that floats will not intrude into the container, and the margins on the container will not collapse with those of the items.

 

设置为display:flex时,是块级弹性容器;设置为display:inline-flex时,是行内级弹性容器。

posted on 2018-03-01 21:52  程序媛鼓励师  阅读(2142)  评论(0编辑  收藏  举报