flex布局属性介绍

阮一峰的flex布局网址:http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html

display:flex;

六个属性:

flex-direction:row | row-reverse | column | column-reverse;
/*
属性决定主轴的方向(即项目的排列方向)*/

flex-wrap:nowrap | wrap | wrap-reverse;
/*默认情况下,项目都排在一条线(又称"轴线")上。flex-wrap属性定义,如果一条轴线排不下,如何换行*/

flex-flow:
<flex-direction> || <flex-wrap>;
/*flex-flow属性是flex-direction属性和flex-wrap属性的简写形式,默认值为row nowrap。*/

justify-content
: flex-start | flex-end | center | space-between | space-around;
/*justify-content属性定义了项目在主轴上的对齐方式。*/

align-items:
flex-start | flex-end | center | baseline | stretch;
/*align-items属性定义项目在交叉轴上如何对齐。(
stretchs伸展)*/


align-content:
flex-start | flex-end | center | space-between | space-around | stretch;
/*align-content属性定义了多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用。*/

 

posted @ 2020-12-01 13:37  嗯哼Nymph  阅读(142)  评论(0编辑  收藏  举报