FLASH SALE Get 20% OFF everything using the coupon code: FLASH20 View WordPress Plugins →

Quick Tip: How to Center Images in a WordPress Gallery Block

on in Blog
Last modified on

Here’s a quick tip for centering images in a WordPress 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;

Related posts

Leave a Reply

Your email address will not be published. Required fields are marked *