Support » Fixing WordPress » Padding under images

  • Hi, I am having a border around the images in my posts which come from

    .alignleft, .alignright, .aligncenter, .alignnone {
     border: 1px solid #ccc;
    }

    in my stylesheet. Now when I insert images with Gutenberg, there is a padding of about 3-5 pixel between the bottom of the image and the border which I would like to remove, but don’t know how. Any help?

    • This topic was modified 9 months, 3 weeks ago by  Lucille85.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Please provide a link to a page on your site where we can see this. Thanks.

    It isn’t my site, but you can see it here, scroll to the image with a boat, padding is 5px, but padding-bottom is more than padding top, left and right.

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Yes, I’ve seen that, padding: 5px. But as I said before, it’s 5px at the top, left and right, but padding-bottom is more than 5px. So how is that possible?

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Override the bottom’s padding in the Custom CSS for your site.

    Then it’s ok for new posts written with Gutenberg, but all the old ones have strange borders.

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    Please provide a link to a page on your site where we can see this. Thanks.

    I’m testing on a local installation, so I can’t. But I’ve found a solution meanwhile, I changed

    .alignleft, .alignright, .aligncenter, .alignnone {
     border: 1px solid #ccc;
    }

    to

    img[class*="align"],
    img[class*="wp-image-"] {
    	border: 1px solid #ccc;
    }

    and now there is no more padding on any side anymore.
    Thanks for your help!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Padding under images’ is closed to new replies.