Archived topic
Footer CSS Issue
10 replies · Started by Jay on November 27, 2018
Hey Guys,
I discovered what I think may be a typo in the footer CSS late last night. Basically there was an EM added just to "Posts" causing my footer to not land directly at the bottom of my Single Posts. I fixed it with some CSS but thinking because it was so localized it may not be intentional. Attaching a copy of my emails with Elementor just in case you want to adjust in the next update push. Sorry in advance, if I am wrong.
Cheers,
Jay
"Thank you for contacting us.
I am afraid, this issue is occurring because of some CSS added by your theme
https://i.imgur.com/kuV4TVv.jpg
Please paste the below CSS in your Apperance>Customize>Additonal CSS to resolve the issue
.elementor-type-footer.post {
margin-bottom: 0;
}
Please let me know in case you need any further assistance."
Hi there,
that CSS is required by the GP Theme for its templates.
Probably more the question is why does elementor include that class in its markup? You will notice on the Home Page the element class = page. So looks like their adding a class unnecessarily (?).
Would be good to understand why they do this.
I get that the CSS needs to be there for the theme, but why is there a bottom margin of 2EM for just posts? Why isn't it just 0EM like it is for page designation?
The post class is added to the articles displayed in the blog / archives / indexes to create the gutter between posts. There is no sensible reason for them to add those classes to a footer element.
My footer is built in Elementor - not using the theme settings. That being the case wouldn't Elementor be controlling that CSS then?
Exactly. They have chosen to add the post class to their markup and neglect to provide it with any CSS. They could have provided you with this fix (and maybe they should be including that):
.elementor.elementor-type-footer {
margin-bottom: 0;
}
and it would have achieved the same result. But it would make more sense if they explained why they need to add the post class to a footer element.
As David mentioned, that CSS is necessary within the theme.
What we do to prevent the margin on pages/indexes with only one post, is target the last post within the main content and remove the margin.
In this case, their class is displaying outside of the main content (as it's not really a post), so our CSS removing the margin doesn't apply.
It would definitely be a good idea for them to remove that class from their elements, as many themes will utilize the .post class assuming that it will only apply to the blog posts/pages.
Now I am starting to get it. Can you tell my why you are specifying a 2EM margin and not just a 0EM one?
It's just the value we chose when creating the theme.
In most cases, the margin is overwritten (usually by the separating space), but it's not something we can remove completely as it does still have its purposes.
Got it. Thanks Tom.
No problem :)