Here’s a quick tip for centering images in a WordPress image gallery block vertically and horizontally. I used this for a client logo list (see an example below).
.gallery--vertical-sample .blocks-gallery-grid,
.gallery--vertical-sample .wp-block-gallery {
justify-content: center;
align-items: center;
}
.gallery--vertical-sample .blocks-gallery-grid .blocks-gallery-image,
.gallery--vertical-sample .blocks-gallery-grid .blocks-gallery-item,
.gallery--vertical-sample .wp-block-gallery .blocks-gallery-image,
.gallery--vertical-sample .wp-block-gallery .blocks-gallery-item {
align-items: center;
}
![](https://getbutterfly.com/wp-content/uploads/2021/04/logo-sample-40.png)
![](https://getbutterfly.com/wp-content/uploads/2021/04/logo-sample-80.png)
![](https://getbutterfly.com/wp-content/uploads/2021/04/logo-sample-120.png)
![](https://getbutterfly.com/wp-content/uploads/2021/04/logo-sample-160.png)
![](https://getbutterfly.com/wp-content/uploads/2021/04/logo-sample-200.png)
![](https://getbutterfly.com/wp-content/uploads/2021/04/logo-sample-240.png)