The align-content
property
aligns a flex container's lines within the flex container
when there is extra space on the cross-axis.
This property has no effect on single line flexible boxes.
align-content: stretch|center|flex-start|flex-end|space-between|space-around|initial|inherit;
align-content |
Yes | 11.0 | 28.0 | 7.0 -webkit- | 12.1 |
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#container > div {<!-- w w w. j a v a2s. co m-->
display: flex;
flex-flow: row wrap;
width: 140px;
height: 140px;
background:red;
}
#container > div > div {
margin: 2px;
width: 30px;
min-height: 30px;
background: black;
}
#flex-start {
align-content: flex-start;
}
#center {
align-content: center;
}
#flex-end {
align-content: flex-end;
}
#space-between {
align-content: space-between;
}
#space-around {
align-content: space-around;
}
#stretch {
align-content: stretch;
}
</style>
</head>
<body>
<div id="container">
<p>align-content: flex-start</p>
<div id="flex-start">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<p>align-content: center</p>
<div id="center">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<p>align-content: flex-end</p>
<div id="flex-end">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<p>align-content: space-between</p>
<div id="space-between">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<p>align-content: space-around</p>
<div id="space-around">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<p>align-content: stretch</p>
<div id="stretch">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</body>
</html>