justify-content: flex-start | flex-end | center | space-between | space-around;(1)flex-start:交叉轴的起点对齐。
.Box {
background:blue;
display: flex;
justify-content:flex-start;
}
.Box{ background:blue;
display: flex;
justify-content:flex-end;
}
.Box{ background:blue;
display: flex;
justify-content:center;
}
.Box{ background:blue; display: flex; justify-content:space-between; }
.Box{ background:blue; display: flex; justify-content:space-around; }
align-items: flex-start | flex-end | center | baseline | stretch;
(1)flex-start:默认值,左对齐
.Box {
height: 700px;
background: blue;
display: flex;
align-items: flex-start;
}
.Box { height: 700px; background: blue; display: flex; align-items: flex-end; }
.Box { height: 700px; background: blue; display: flex; align-items:center; }
.Box { height: 700px; background: blue; display: flex; align-items: baseline; }我设了三个盒子设置了不同的字体大小,效果会更加明显。
.Box {
height: 300px;
background: blue;
display: flex;
align-items: stretch;
}
.Box div {
/*不设置高度,元素在垂直方向上铺满父容器*/
width: 200px;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。