Site logo

Archived topic

No padding below images any more

11 replies · Started by Matthew on December 1, 2022

Viewing posts 1–12 of 12

Hello,

I switched to Generatepress a few months ago and don't recall having this issue until recently.

Basically, in a post there should automatically be some padding between any image and the text below it. Recently, all images in my posts have no padding below them.

Example: redacted

This isn't the case inside the editor. I can resolve it manually by adding space but it should be automatic.

Please help me resolve this.

Thank you

Hi there,

it happened in WP 6.1 where they moved HTML/Classes that applied the bottom margin.
until we find a way to overcome their change without effecting everyones sites who don't have an issue you will need to add some CSS:


figure {
    margin-bottom: 1.5em;
}

Thank you David.

That code only appears to relate to the featured image as the remaining images still have no lower padding (please see same example).

Can you kindly let me know the CSS to apply to all post images?

Hi Matthew,

Can you try updating the code provided to this?:

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

Let us how it goes.

Hi Fernando,

That seems to work for most images but interestingly now the featured image in the above example is displaying without padding for me. I've tried clearing the cache and different browsers. Is it working for you?

Some images on my site still don't have the padding for some reason but most do.

Hi Fernando,

I have provided links in the private section.

Thank you

Try this CSS to cover all bases:


figure,
.wp-block-image,
.wp-block-image figure {
    margin-bottom: 1.5em;
}

That seems to have done the trick. Thank you both.

Glad to hear that !

Is this still the fix? I updated yesterday and it screwed up SOME of our images. But not all. This bandaid fixed it but it's causing other issues. It is now pushing down out affiliate disclosure block that will tuck up below the first image (not the featured, as it is not displayed, but the first in content image).

It's probably fixable by giving the affiliate disclosure (it's a reusable block) it's own CSS Class and custom CSS, but 1) I don't feel like trying to figure it out and 2) just seems "unnecessary."

Hi Michael,

WordPress keeps on changing things so it's difficult for us to keep up.

Can you start a new topic and link me to the page(s) in question?

We can take a look to see which CSS would work the best in your case.

Thanks!

This archived topic is closed to new replies.