Archived topic
Fixing the 0px margin under images for posts and pages
3 replies · Started by Anne on November 3, 2022
Hello team,
I'm using the Coach theme which looks gorgeous, but there's one thing that's off: there is a 0px bottom margin around images in posts and pages. I have added a link below with an example. How can I add a 15px margin only targeting those images? The problem with targeting the wp-block-image class is that it's also used in other places like images on the homepage where I don't necessarily want to add any extra margin around images.
Thank you!
Hi Anne,
To clarify, are you wanting to add a 15px margin-bottom to all images on single posts and pages except for the homepage?
If so, try adding this CSS in Appearance > Customize > Additional CSS:
body:is(.page,.single-post):not(.home) .wp-block-image {
margin-bottom: 15px;
}
Yes, that's what I want to do – just tried it and it looks perfect! Thank you so much for the super fast reply :)
You're welcome Anne! :)