Support

Home Forums Event Espresso Premium EE4 expands top margin of page

EE4 expands top margin of page

Posted: January 7, 2015 at 2:38 pm

Viewing 6 reply threads


Martin

January 7, 2015 at 2:38 pm

Hello EE team,
Site http://test.mht2.de. Latest version of EE on WP4.1 creates an extra margin at the top of theme pages (standard and full width; all of them). Deactivate EE and the extra margin disappears; activate and it pushes all the content down on the page.

How can that be countered?


Seth Shoultes

  • Support Staff

January 7, 2015 at 11:39 pm

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.

.hentry {
    margin-top: 90px;
}

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?


Seth Shoultes

  • Support Staff

January 7, 2015 at 11:44 pm

Here’s a screenshot of what it looks like without the margin-top:
http://www.screencast.com/t/F93SxFneQl


Martin

January 16, 2015 at 3:56 am

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?


Brent Christensen

  • Support Staff

January 16, 2015 at 11:34 am

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.
However, for the first blog post on the page, this margin is getting overridden by the following:

.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?

  • This reply was modified 9 years, 8 months ago by Brent Christensen. Reason: changed margin-bottom:90px; to margin-top:90px;
  • This reply was modified 9 years, 8 months ago by Brent Christensen. Reason: changed text explaining css rule


Martin

January 19, 2015 at 8:12 am

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!


Seth Shoultes

  • Support Staff

January 29, 2015 at 12:49 pm

Hi Tammi,

Were you able to get this fixed?

Viewing 6 reply threads

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.

Event Espresso