Posted: January 7, 2015 at 2:38 pm
|
Hello EE team, How can that be countered? |
Hello Martin, It looks like there is a css rule in your theme (wp-content/themes/x/framework/css/site/stacks/renew.css) that is pushing the content down the page.
However, I also notice that EE loads some hidden divs on the same pages. Do you have the ability to safely modify or remove that css rule? |
|
Here’s a screenshot of what it looks like without the margin-top: |
|
|
Hi, Tammi here for Martin. The problem goes away when EE is deactivated. Any idea why those EE loads are happening on pages that do not have anything to do with EE? |
Hi Tammi and Martin, That margin is being added by the css rule that Seth pointed out:
.hentry {
margin-top: 90px;
}
That margin is being applied to every blog post that appears on your site.
.hentry:first-child {
margin-top: 0;
}
which incorrectly assumes that the article.hentry items will ALWAYS be the first item on the page. Now the reason that those margins only affects things when Event Espresso is active, is because Event Espresso inserts some hidden div containers at the top of the page for displaying error messages and our AJAX loading image. Normally, hidden containers shouldn’t affect the DOM because they are… well.. hidden. Unfortunately in this case, it also means that the first article.hentry item is not the first item on the page, and therefore does not get it’s margin removed. Anyways, because the intent of those two rules above is to add 90px of space between adjacent blog posts, this can better be achieved by removing those two rules, and instead using the following:
.hentry + .hentry {
margin-top:90px;
}
which will ONLY apply the margin to the top of an article.hentry item when it is immediately preceded by another article.hentry item, instead of adding margin to the tops of ALL article.hentry items and then attempt to remove it from the first one. Does that make sense?
|
|
|
Tammi here. I am no CSS profi, so I will simply give it a try and trust that it works. 🙂 Thanks for taking the time to explain how/why this works as it does! |
Hi Tammi, Were you able to get this fixed? |
|
The support post ‘EE4 expands top margin of page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.