Archived topic
Header and Footer margin in posts
7 replies · Started by Sergio on November 21, 2018
Hi there, I built my website using Elementor Pro + GP Premium. I created my template for single posts and noticed something weird. The header and footer suddenly have a bottom margin. It seems to be coming from stylesheet style.min.css using .post{margin:0 0 2em}. It only does this in single posts, not the entire website.
Thanks.
Hi there,
GP has this CSS:
.separate-containers .site-main > *:last-child,
.one-container .site-main > *:last-child {
margin-bottom: 0;
}
However, your site is missing the .site-main element, so it's not applying.
That element exists in single.php: https://github.com/tomusborne/generatepress/blob/2.2.1/single.php#L15
Are you using a custom single.php file?
Why is it missing the site main?
Good question! :)
The element is there inside the core theme files.
Are you using any custom template files in your child theme?
Sorry I didn´t read your full first response. No I´m not using any custom single.php. I just downloaded and installed the child theme from your website. The weird thing is that since I´m using Elementor Pro, and creating a template for all single posts, it should pretty much override your CSS, right?
Strange, maybe they're overwriting the template.
Either way, you can do this to remove it:
.elementor.post {
margin-bottom: 0;
}
Awesome! It´s weird it overwriting the template but that code seems to do the trick.
Thanks a lot Tom!
You're welcome :)