Remove border around blog post images

Hi,

I’m struggling to remove borders that automatically appear around images in my blog posts.

To explain:

  • I’m using the integrity stack;

  • When I put images into my blog posts without captions of any form, they appear without borders. This is precisely how I want them to look!

  • However when I provide captions for my images, a light grey border appears around the image. I’d like to remove that border.

  • Also my caption text is showing as centred and in all caps. I’d like it to be left aligned and in sentence capitalisation i.e. This is how I’d like a caption to look…

The screenshot below shows the border that I’d like to remove and the caption text that I’d like to left align. To be clear, the image in the screenshot isn’t a featured image, it’s just a normal image.

Any help you can provide me will be much appreciated!

Thanks.

Hey @Dr_Jules_G,

Try adding this code in Appearance > Theme Options > Global CSS.

.wp-caption>.wp-caption-text, .wp-caption>.wp-caption-text:last-child {
    text-align: left;
    text-transform: none;
}

Hope that helps.

Thanks for the rapid reply!

That’s fixed the caption alignment, but not removed the frame around the image. Any suggestions as to how I can remove that?

Thanks.

Hi There,

Please try adding this custom CSS under X > Theme Options > CSS:

.wp-caption, .gallery-item {padding: 0;}

Hope it helps :slight_smile:

Hi @thai,

Many thanks for the suggestion - it almost solved the problem, but gave me enough that I managed to fix it.

I built on your CSS adding a couple of lines in (shown below) and the problems sorted.

.wp-caption, .gallery-item {
padding: 0;
border: none;
box-shadow: none;
}

Many thanks for your and @christian_y’s rapid and helpful replies!

You’re welcome. I missed giving the border code in my previous reply but glad you’ve sorted it out. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.