flex-direction属性flex-direction属性决定主轴的方向(即项目的排列方向)。

它可能有4个值。

1.row(默认值):主轴为水平方向,起点在左端。

2.row-reverse:主轴为水平方向,起点在右端。

3.column:主轴为垂直方向,起点在上沿。

4.column-reverse:主轴为垂直方向,起点在下沿。

justify-content

/* 对齐方式 */
justify-content: center;     /* 居中排列 */
justify-content: start;      /* 从行首开始排列 */
justify-content: end;        /* 从行尾开始排列 */
justify-content: flex-start; /* 从行首起始位置开始排列 */
justify-content: flex-end;   /* 从行尾位置开始排列 */
justify-content: left;       /* 一个挨一个在对齐容器得左边缘 */
justify-content: right;      /* 元素以容器右边缘为基准,一个挨着一个对齐, */

/* 基线对齐 */
justify-content: baseline;
justify-content: first baseline;
justify-content: last baseline;

/* 分配弹性元素方式 */
justify-content: space-between;  /* 均匀排列每个元素
                                   首个元素放置于起点,末尾元素放置于终点 */
justify-content: space-around;  /* 均匀排列每个元素
                                   每个元素周围分配相同的空间 */
justify-content: space-evenly;  /* 均匀排列每个元素
                                   每个元素之间的间隔相等 */
justify-content: stretch;       /* 均匀排列每个元素
                                   'auto'-sized 的元素会被拉伸以适应容器的大小 */

/* 溢出对齐方式 */
justify-content: safe center;
justify-content: unsafe center;

/* 全局值 */
justify-content: inherit;
justify-content: initial;
justify-content: unset;

:focus

:focus选择器用于选取获得焦点的元素。

:focus是一个伪类,它适用于具有焦点的元素。

:focus应用于元素具有焦点的时间内。

posted on 2021-11-01 20:17  于凡芮  阅读(74)  评论(0)    收藏  举报