align-content属性用于修改flex-wrap属性的行为-------------因为换行后就有多行啦,就可以使用align-content属性了。
它类似于align-items,但他不是设置弹性子元素的对齐,而是设置各个行的对齐。
flex-warp是否换行区别
不换行会压缩自己宽度,换行不会
![](https://i-blog.csdnimg.cn/blog_migrate/5c321b7301b87b1d40601386459e740c.png)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.container{
width:200px;
height: 200px;
background-color: #008000;
display: flex;
flex-wrap:nowrap;
}
.a{
width: 100px;
height: 50px;
background-color:yellow;
}
.b{
width: 100px;
height: 50px;
background-color:goldenrod;
}
.c{
width: 100px;
height: 50px;
background-color:gold;
}
</style>
</head>
<body>
<div class="container">
<div class="a cc">11</div>
<div class="b cc">22</div>
<div class="c cc">33</div>
</div>
</body>
</html>
![](https://i-blog.csdnimg.cn/blog_migrate/cb6b7fc3d3d7cafd686020d3ee56548b.png)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.container{
width:200px;
height: 200px;
background-color: #008000;
display: flex;
/* 看这里 */
flex-wrap:wrap;
}
.a{
width: 100px;
height: 50px;
background-color:yellow;
}
.b{
width: 100px;
height: 50px;
background-color:goldenrod;
}
.c{
width: 100px;
height: 50px;
background-color:gold;
}
</style>
</head>
<body>
<div class&#