[Resolved] Gallery Spacing

Home Forums Support [Resolved] Gallery Spacing

Home Forums Support Gallery Spacing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2339970
    Carl

    Hi – I looked for this information, but I couldn’t find anything that helped with my theme. My gallery has a lot of spacing/margin between the images and caption – vertically and horizontally. How can I reduce this?

    I tried targeting the block gallery, but then other things shifted as well.

    .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image){margin:0px -20px -40px -20px !important;}
    .wp-block-gallery{margin:0px 20px 20px 20px;}
    #2340038
    Fernando
    Customer Support

    Hi Carl,

    Can you try this CSS?:

    .wp-block-gallery {
        gap: 0.2em;
    }

    This would work on all WP Gallery Blocks. If you want it more specific, add a class to the class list of your Gallery Blocks and add that as a selector for your CSS.

    An alternative would be to use a GenerateBlocks Grid Blocks which has spacing settings you can easily modify: https://docs.generateblocks.com/article/grid-overview/

    #2340183
    Carl

    I just added an !important and that works perfect – thanks!

    #2340221
    Fernando
    Customer Support

    You’re welcome Carl!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.