Site logo

Archived topic

Border everytime I add an image to a post

20 replies · Started by Sebastián on April 6, 2019

Viewing posts 1–15 of 21

Hi!

Is it possible to automatically add (with code) a 1 px black border everytime I add an image to a post.

I want every single one of my post images having a border to highlight even more.

Thanks!

Hi there,

some CSS like this will do - it's specific to the single post:

.single-post img {
    outline: 1px solid #000;
}

That was fast.

Thank you so much!

Glad to be of help :)

On one of my websites https://nichoseo.com/que-es/ even the header logo looks with the border. I didn't had any problem when I asked this for a different website.

What could be the problem? Thanks

Try this instead:

.single-post .entry-content img {
    outline: 1px solid #000;
}

Didn't worked :(

Hi Leo, the screenshot you took is from https://donde.uy/ there it's working well.

Now the site im having the problems is https://nichoseo.com/que-es

I put the code to prove that even the logo has the border.

And when adding this:

.single-post .entry-content img {
outline: 1px solid #000;
}

It doesn't change anything.

Thanks!

The other site is also working to me:
https://www.screencast.com/t/W3tsv7GNNd

And this is the CSS that's adding the border:

.single-post img {
    outline: 3px solid #000;
}

Make sure to clear and caching plugin when you make changes.

Looks like entry-content class is removed when using Elementor.

Try this:

.single-post .site-content img {
    outline: 1px solid #000;
}

That worked for me! But, I don't want that border on my featured images. Is it possible to apply the same code and leave the featured image without it?

This archived topic is closed to new replies.