Archived topic
Border everytime I add an image to a post
20 replies · Started by Sebastián on April 6, 2019
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 :(
Looks like you still have David's original CSS added but it working to me:
https://www.screencast.com/t/icJNmFaxIlN
Make sure to clear and caching plugin when you make changes.
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.
Yes but it's adding border on other images from the page: https://imgur.com/fHwmQqg
And I don't want that.
That's because that site is using this CSS I mentioned above:
https://generatepress.com/forums/topic/border-everytime-i-add-an-image-to-a-post/#post-868736
and not using Tom's (correct) CSS here:
https://generatepress.com/forums/topic/border-everytime-i-add-an-image-to-a-post/#post-868204
Make sure to clear and caching plugin when you make changes.
When I put Tom's CSS the border dissapears: https://imgur.com/H31NM96
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?