- This topic has 7 replies, 3 voices, and was last updated 3 years, 3 months ago by
Ying.
-
AuthorPosts
-
January 27, 2023 at 9:18 am #2511291
Benjamin
Hi, I also wanted to use this code:
https://generatepress.com/forums/topic/no-spacing-beneath-images-in-a-post/#post-2417991
https://generatepress.com/forums/topic/why-there-is-no-bottom-margin-on-images-and-how-i-add-it/Slight problem- the wp-image variation fixes some of the images, and the figure variation fixes other sets of images and the youtube videos.
Anyway, the point is in all cases, there are always images/ videos that are broken.
Can you please provide code to fix all of these? I’ll attach the pages that I’m using for reference in the sensitive information section. Look at the images and youtube videos (if applicable) on these pages.
Thanks.
January 27, 2023 at 10:25 am #2511344Leo
StaffCustomer SupportHi Benjamin,
Anyway, the point is in all cases, there are always images/ videos that are broken.
Not sure if I fully understand the statement above.
Can you first apply Fernando’s CSS here?
https://generatepress.com/forums/topic/why-there-is-no-bottom-margin-on-images-and-how-i-add-it/It should work well from what I can see. Let me know when it’s added so I can see the issue.
Thanks!
January 27, 2023 at 12:25 pm #2511461Benjamin
I apologize, I really didn’t explain that well.
With this code below, all of the videos & images have margins in posts, but images on pages don’t have a margin. (The images on the page I am referencing are set to center).
figure {
margin-bottom: 1.5em;
}(I currently have this code active).
With this code below, the images on the pages & posts have a margin, but not the videos in the post.
.wp-block-image {
margin-bottom: 1.5em;
}I have tried combining it as follows (below), but then nothing works.
.wp-block-image figure {
margin-bottom: 1.5em;
}I just tested it with both added separately, and that works, but I don’t want to add unnecessary/double code. That said, if this is the only solution, then it is fine.
I also just set the images to align: “none” and then the figure code works. Maybe that would be the simplest solution here, but it doesn’t seem very elegant. XD.
Anyway, sorry for this long inquiry, I hope that makes more sense, and let me know. Thanks.
January 27, 2023 at 4:28 pm #2511589Leo
StaffCustomer SupportI just checked the two links you’ve provided and don’t see an issue at all.
All the images have this code applied:
figure { margin-bottom: 1.5em; }Can you guide me to an image that is still having an issue?
January 28, 2023 at 3:11 am #2511819Benjamin
Yes, thanks, that’s because I set the images on the page to align = none.
If it is set to center on pages, then it doesn’t work with that code.
But anyway, I guess we figured it out.
I should say, I really wish GP just fixed this in the theme code, it is such a simple problem, and so many of the users have trouble with this.
Thanks.
January 28, 2023 at 12:28 pm #2512322Leo
StaffCustomer SupportIt’s more of a WordPress problem.
Any chance you can set an image to center align so I can see why the code isn’t working?
February 3, 2023 at 3:20 am #2519796Benjamin
My bad for taking so long to respond. (Kind of forgot about this but somehow remembered it just now XD).
I set the first 2 to center align on the about page of my staging site, and the last one is on align none.
See the sensitive info section for the URL.
Thanks.
February 3, 2023 at 10:16 am #2520412Ying
StaffCustomer SupportHi there,
try this CSS instead:
.entry-content .wp-block-image figure { margin-bottom: 1.5em; } -
AuthorPosts
- You must be logged in to reply to this topic.