Landing page: Make contents hide behind the header while scrolling
I want the rest of the contents to be hidden behind the header portion while I scroll the page. How do I make the main body contents to hide once it reach the header section while scrolling? The way I figured out to do so was by giving the header a background color; but I want the background image to be visible .
Also any suggestions or review of the site is very appreciated. :slight_smile:

This can be achived by fixind background in place:

body {
  /* ... */
  background-attachment: fixed;

not exactly what I meant. The rest contents of the page is visible behind the navbar section when I scroll the page. above code just makes the background fixed. open the link and try scrolling, you will understand what the problem is.

I believe what you’re looking for is a “change opacity on scroll” feature. The only way you’ll be able to accomplish something like this would be with JavaScript.

Unfortunately I’m on my phone and typing up code would be a b-

Doing a google search should bring up some tutorials.

Good luck.

I understood that. In order for content to hide behind the header, header has to have exact same background fixed in exact same position, right?

1 Like

Got it. Thanks a ton :)))

Making background attachment fixed in both body and header fixed it. Thanks though :slight_smile: