- This topic has 20 replies, 4 voices, and was last updated 3 years ago by
David.
-
AuthorPosts
-
April 6, 2019 at 7:44 am #861418
Sebastián
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!
GeneratePress 2.2.2April 6, 2019 at 7:50 am #861428David
StaffCustomer SupportHi there,
some CSS like this will do – it’s specific to the single post:
.single-post img { outline: 1px solid #000; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 6, 2019 at 7:52 am #861430Sebastián
That was fast.
Thank you so much!
April 6, 2019 at 7:58 am #861435David
StaffCustomer SupportGlad to be of help 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 13, 2019 at 1:37 pm #868143Sebastián
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
April 13, 2019 at 4:51 pm #868204Tom
Lead DeveloperLead DeveloperTry this instead:
.single-post .entry-content img { outline: 1px solid #000; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 13, 2019 at 5:07 pm #868214Sebastián
Didn’t worked 🙁
April 13, 2019 at 5:39 pm #868223Leo
StaffCustomer SupportLooks like you still have David’s original CSS added but it working to me:
https://www.screencast.com/t/icJNmFaxIlNMake sure to clear and caching plugin when you make changes.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 14, 2019 at 10:34 am #868727Sebastián
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!
April 14, 2019 at 10:49 am #868736Leo
StaffCustomer SupportThe other site is also working to me:
https://www.screencast.com/t/W3tsv7GNNdAnd 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 14, 2019 at 10:52 am #868742Sebastián
Yes but it’s adding border on other images from the page: https://imgur.com/fHwmQqg
And I don’t want that.
April 14, 2019 at 10:53 am #868744Leo
StaffCustomer SupportThat’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-868736and not using Tom’s (correct) CSS here:
https://generatepress.com/forums/topic/border-everytime-i-add-an-image-to-a-post/#post-868204Make sure to clear and caching plugin when you make changes.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 14, 2019 at 10:56 am #868746Sebastián
When I put Tom’s CSS the border dissapears: https://imgur.com/H31NM96
April 14, 2019 at 11:19 am #868758Leo
StaffCustomer SupportLooks like
entry-content
class is removed when using Elementor.Try this:
.single-post .site-content img { outline: 1px solid #000; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 8, 2020 at 5:23 am #1188504Sebastián
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?
-
AuthorPosts
- You must be logged in to reply to this topic.