Site logo

Archived topic

Cannot Place Main Content over Header

7 replies · Started by Anonymous on November 17, 2014

Viewing posts 1–8 of 8

Hello,

I am trying to have the main content of the blog overlap the header by a margin-top offset, using the generate_before/after_main_content action hooks.

The effect is to place this div container:

<div id="content-lift"></div>

just inside the <main> container. This div contains the following CSS:

margin-top: -80px;
z-index: 1;

This didn't work on it's own, so I tried to ensure the z-order was correct by creating another div container and enclosing the header in that:

<div id="unfix-header"> <header></header> </div>

That div contained the following CSS:

z-index: 0;

I don't understand why the header image continues to be on top despite these changes.

Can you possibly link me to the site where you're trying this so I can see exactly what's not working and offer a solution?

Thanks!

Sure. Could I send it to you privately?

Thank you. I've sent you a link.

Ah - add position:relative to your #content-life CSS - z-index needs the element to be relative in order to work.

That should do it.

Beautiful! It's always those small details that get me. Thanks, Tom. Have a lovely day.

Happy I could help :)

This archived topic is closed to new replies.