joshuaaron joshuaaron - 1 month ago 6
Sass (Sass) Question

Content pushing down and up with fixed bg issue

I'm needing a fixed full size background in a section that is below the navbar. When I get down to mobile, and toggle my navigation, it pushes the section down including the image - but once fully expanded it will go back up while the content stays where it is meant to.

If I change the background from fixed then my content will be too long for the image's height and this is not what I'm after.

Can anyone offer a solution?

I've included a codepen below - please note this is just a snippet to provide an example.

(need to provide code to link codepen)

.contact__full-bg-container {
width: 100%
height: 100%
...
}


http://codepen.io/jreynolds90/pen/BLqZvj

Answer

You need to add some css to .nav--lower. Try adding:

position: absolute;
z-index: 1;