一、flex-direction: (元素排列方向)
※ flex-direction:row (横向从左到右排列==左对齐)
※ flex-direction:row-reverse (与row 相反)
※ flex-direction:column (从上往下排列==顶对齐)
※ flex-direction:column-reverse (与column 相反)
二、flex-wrap: (内容一行容不下的时候才有效)
※flex-wrap:nowrap (超出不换行,很奇怪里面的宽度会变成100%)
※ flex-wrap:wrap (超出按父级的高度平分)
※flex-wrap:wrap-reverse(与wrap 相反)
三、justify-content: (水平对齐方式)
※flex-start (水平左对齐)
※ justify-content:flex-end; (水平右对齐)
※ justify-content:center;(水平居中对齐)
※justify-content:space-between; (两端对齐)
※justify-content:space-around; (两端间距对其)
四、align-items: (垂直对齐方式)
※ align-items:stretch; (默认)
※align-items:flex-start; (上对齐,和默认差不多)
※align-items:flex-end; (下对齐)
※ align-items:center;(居中对齐)
=※align-items:baseline; (基线对齐)
如弹性盒子元素的行内轴与侧轴(纵轴)为同一条,则该值与'flex-start'等效。其它情况下,该值将参与基线对齐。
flex容器属性
/*1.方向*/ /*默认方向(row正方向)*/ /* flex-direction: row; */ /*row反方向*/ /* flex-direction: row-reverse; */ /*columnz正方向*/ /*flex-direction: column;*/ /*columnz反方向*/ /*flex-direction: column-reverse;*/ /*2.换行*/ /*flex-wrap: wrap;*/ /*flex-wrap: wrap-reverse;*/ /*3.direction+wrep组合*/ /*flex-flow: row wrap-reverse;*/ /*4.主轴对齐*/ /*起点左对齐*/ /*justify-content: flex-start;*/ /*起点右对齐*/ /*justify-content: flex-end;*/ /*起点居中对齐*/ /*justify-content: center;*/ /*间隔左右分散*/ /*justify-content: space-between;*/ /*间隔内边距相等*/ /*justify-content: space-around;*/ /*间隔相等*/ /*justify-content: space-evenly;*/ /*5.交叉轴对齐 当flex-direction: row;修饰y轴, 当flex-direction: column;修饰x轴*/ /*默认交叉轴对齐*/ /*align-items: stretch;*/ /*默认交叉轴居中*/ /*align-items: center;*/ /*默认交叉轴上对齐*/ /*align-items: flex-start;*/ /*默认交叉轴下对齐*/ /*align-items: flex-end;*/ /*默认交叉轴内容对齐*/ /*align-items: baseline;*/ /*6.多行交叉轴对齐*/ /*align-content: stretch;*/ /*多行交叉轴居中对齐*/ /*align-content: center;*/ /*多行交叉轴上对齐*/ /*align-content: flex-start;*/ /*多行交叉轴下对齐*/ /*align-content: flex-end;*/ /*多行交叉轴内边距相等*/ /*align-content: space-around;*/ /*多行交叉轴间隔左右分散*/ /*align-content: space-between;*/ /*多行交叉轴间隔相等*/ /*align-content: space-evenly;*/
flex项目属性
/*1.控制项目次序*/ /*order: 2;*/ /*2.按比例扩大空间,数越大空间越大,0值不扩大*/ /*flex-grow: 2;*/ /*3.按比例缩小空间,数越大空间越小,0值不压缩*/ /*flex-shrink: 2;*/ /*4.需要flex-direction配合使用,row=宽 column=高,并且优先级高于width hight, auto值 让位优先级*/ /*flex-basis: 600px;*/ /*5.flex=grow+shrink+basis*/ /*grow =1 && shrink = 1 && basis = auto*/ /*flex: auto;*/ /*grow =0 && shrink = 1 && basis = auto*/ /*flex: initial;*/ /*grow =0 && shrink = 0 && basis = auto*/ /*flex: none;*/ /*6.align-self覆盖容器的align-items*/ /*align-self: flex-start;*/
更新日志
- 【原神】V5.0攻略 | 林尼攻略一图流
- 李翊君.1993-相思的烈酒【上华】【WAV+CUE】
- 古巨基.1998-LEO.KU(国)【千禧年代】【WAV+CUE】
- 郭子.2001-原来你什么都不想要创作集丫滚石】【WAV+CUE】
- 《使命召唤:黑色行动6》新预告公布!10月25日发售
- Atlus《暗喻幻想》媒体评分汇总:高分好评如潮!
- 2024金摇杆奖提名揭晓 《黑神话》角逐最佳视觉设计!
- 群星《新说唱2024 第3期 (上)》[320K/MP3][32.76MB]
- 群星《新说唱2024 第3期 (上)》[FLAC/分轨][95.38MB]
- 群星《新说唱2024 第3期 (下)》[320K/MP3][31.36MB]
- 幻兽帕鲁手游什么时候正式上线 最新消息一览
- 西普大陆BOSS位置盘点 解锁天启纪元玩法
- 西普大陆精灵进阶培养攻略 精灵养成指南
- dnf手游法控法系职业哪个强 dnf手游法控法系职业强度排行
- 魔兽世界血藤护目镜图纸在哪买 wlk血藤护目镜图纸购买位置介绍