不去做怎么知道做不到,用心做好每一天做好每一件事。|

轻风细雨_林木木

园龄:6年3个月粉丝:4关注:1

2018前端难点整理

一、弹性盒子

1.基本概念

flex布局的元素称为“flex容器”,里面额子元素成员叫做“flex项目”。
在这里插入图片描述

  • 容器默认存在两根轴:水平的主轴(main axis)和垂直的交叉轴(cross axis)。主轴的开始位置(与边框的交叉点)叫做main start,结束位置叫做main end;交叉轴的开始位置叫做cross start,结束位置叫做cross end。
  • 项目默认沿主轴排列。单个项目占据的主轴空间叫做main size,占据的交叉轴空间叫做cross size。

二、容器的属性

  1. flex-direction     主轴的方向(即项目的排列方向)
  2. flex-wrap           换行方式
  3. flex-flow             flex-direction属性和flex-wrap属性的简写形式
  4. justify-content    项目在主轴上的对齐方式
  5. align-items         项目在交叉轴上如何对齐
  6. align-content      text文本轴线的对齐方式

flex-direction

.box {
flex-direction: row | row-reverse | column | column-reverse;
}

在这里插入图片描述

flex-wrap

.box{
flex-wrap: nowrap | wrap | wrap-reverse;
}

在这里插入图片描述

flex-flow

// flex-flowflex-direction属性和flex-wrap属性的简写形式,默认值为row nowrap。
flex-flow:row-reverse wrap;

justify-content

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

在这里插入图片描述

align-items

align-items属性定义项目在交叉轴上如何对齐。
.box {
align-items: flex-start | flex-end | center | stretch | baseline ;
}

在这里插入图片描述

align-content

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

在这里插入图片描述

三、项目属性

1order
2flex-grow
3flex-shrink
4flex-basis
5flex
6align-self

(1)
在这里插入图片描述


(2)
在这里插入图片描述在这里插入图片描述


(3)
在这里插入图片描述在这里插入图片描述

(4)
在这里插入图片描述

(5)
在这里插入图片描述


(6)
在这里插入图片描述
在这里插入图片描述在这里插入图片描述

本文作者:轻风细雨_林木木

本文链接:https://www.cnblogs.com/linzhifen5/p/16961383.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   轻风细雨_林木木  阅读(25)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 尚好的青春 孙燕姿
  2. 2 孙燕姿
  3. 3 克卜勒 孙燕姿
- 孙燕姿
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.