It's not possible using gallery()
, because CSS doesn't have any way to vertically-center floats. To get a centered gallery, you should use flexbox, grid, display-table, or inline-block layouts. You can still use Susy to do the math, if it helps. Here it is with flexbox:
.container {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.item {
background: lightgray;
flex-basis: span(1 of 6);
margin-right: gutter(of 6);
&:nth-child(6n) {
margin-right: 0;
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.