Archived topic
Global Padding Around Images
4 replies · Started by Lee on March 10, 2022
Hey guys,
Is there a way to add padding around images uploaded to pages? I'd like to create a bit more space between my images and text that's presented directly below it. I'm currently using a "spacer" in the page editor but it would be much easier if there was a global way of changing this.
Many thanks.
Hi there,
try adding this CSS:
figure.wp-block-image,
.gb-grid-wrapper figure.wp-block-image{
margin-bottom: 2em;
}
Thanks for this David,
I've tried adding this code in the customiser but it doesn't seem to be affecting the padding?
Lee.
I've just provided a link to a page to demonstrate the issue I'm having with needing padding around images.
Ok so on that page the images have no captions, and no caption means no <figure> element, so to cover all bases try:
figure.wp-block-image,
.gb-grid-wrapper figure.wp-block-image,
div.wp-block-image,
.gb-grid-wrapper div.wp-block-image {
margin-bottom: 2em ;
}