Archived topic
Cleanest way to reduce the spacing here?
7 replies · Started by Andy on August 26, 2020
Hi there,
I'd like to adjust the spacing (above & below) a single post's featured image. Overall, I'd like to adjust the spacing for desktop and mobile view separately. What's the best way to do this?
Desktop:
https://imgur.com/a/aTjzFMx
Mobile:
https://imgur.com/a/geVc6Ij
Thank you
Hi there,
This CSS is for desktop:
.post-image-below-header.post-image-aligned-center .inside-article .featured-image {
margin-top: 1em;
margin-bottom: 1em;
}
And this is for mobile:
@media (max-width: 768px) {
.post-image-below-header.post-image-aligned-center .inside-article .featured-image {
margin-top: 1em;
margin-bottom: 1em;
}
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know if this helps :)
Perfect, thanks Leo!
Quick question, I noticed for margin-bottom, 2em is the lowest it can go. I tried 1em and .5em and it doesn't reduce the gap.
Am I required to go into the negatives (i.e. -1em)? If so, do you expect negative numbers to cause issues for users' devices?
The rest of the margin is actually coming from the margin-top in the element below it:
https://www.screencast.com/t/wdragbokHh2G
Hi Leo,
I played with the 18px from the screencast you shared, and that reduced the margin below the social media icons.
Just so there's no miscommunication, I'm referring to the margin above the social media icons. Do you know where that gap is coming from? https://imgur.com/a/GQwREjC
Thank you
Hi there,
try adding this CSS:
article .entry-content {
margin-top: 1em;
}
Worked great, thanks David!
You're welcome