Site logo

Archived topic

Where to set image spacing defaults? Can't find it anywhere

5 replies · Started by Michelle on January 20, 2022

Viewing posts 1–6 of 6

Hi, I'm trying to add space below images by default. I see this set for every image in the Generatepress CSS:

.gb-grid-wrapper .wp-block-image { margin-bottom: 0; }

I know I can override that by adding a spacer block beneath every single image, or by adding my own style in a child theme by using !important, but I'd prefer not to do that. Is there a setting somewhere that would let me specify the default for spacing? In Appearance > GeneratePress I have "Spacing" active in the Modules section, but the little settings icon there only allows me to reset or export the settings, not edit them. When I go to Layout Options I can set overall padding for the Container but nothing else.

This topic seems to imply I can set spacing for the Grid blocks, but a) I don't see how, and b) that still sounds like there's no global setting, it'd be set every time I insert a block.
https://generatepress.com/forums/topic/gap-between-image-and-heading-on-mobile-view/

Any ideas? Thanks!

Hi Michelle,

Can you link us to the page where we can see the images?

Here 'tis, but right now I've forced the spacing using an !important declaration in my child-theme's CSS. If you inspect-element on the little icon images above "Authentic / Scalable / Free" you can get rid of my style and see the original one: https://loudcrowd.com/home-new/

Hi Michelle,

This CSS.gb-grid-wrapper .wp-block-image { margin-bottom: 0; } is targeting all the images inside a Grid block, so it's not GP's CSS but GB's.

I think your way of doing it is ok, but change the selector to .wp-block-imageinstead of .gb-grid-wrapper .wp-block-image so it targets all the image blocks on your site, not only the ones inside a grid block:

.wp-block-image {
    margin-bottom: 1.5em!important;
}

Ah, thank you! I thought these were both made & managed by the same company and meant to be used together. I'll look into it from the plugin side. Thanks again!

You are welcome :)

This archived topic is closed to new replies.