第二章flex布局

末鹿安然 提交于 2020-01-24 23:48:51

 1、代码规范

2、所谓布局

3、flex容器将消除item的块状特性

     flex弹性盒子

4、flex-direction的应用

.container{
  display: flex;
  flex-direction: row;
}

5、reverse倒序排布

  /* width 100%  height:自适应的  */
.container{
  display: flex;
  flex-direction: row-reverse;
}

6、  justify-content属性

.container{
  display: flex;
  flex-direction: row-reverse;

  /* 
  justify-content: center;
  justify-content: space-between; 
  justify-content: space-around;
 */
  justify-content: flex-end;
}

7、主轴与交叉轴

.container{
  height:400px ;
  display: flex;
  /* 值为 column 竖直方向为主轴 row 水平方向为主轴  */
  flex-direction: column;
  /* 交叉轴上的单对齐 */
  align-items:center;
  /* 主轴上的对齐 */
  justify-content: center;
}

 

 

 

 

 

 

 

 

 

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