Our website features a header with a fixed position that remains at the top of the page while scrolling. The product team has requested a gap or margin between this fixed element and the top navbar.
However, when we implemented this gap, users started noticing the elements scrolling away above the fixed header. To illustrate this issue, I have created a demonstration on jsfiddle:
https://jsfiddle.net/9n50o567/
As you scroll down, you can see the grey sections appearing above the light-blue header while scrolling.
Is there a way to conceal this from the user? We want only the background color or image to be visible above the fixed element, masking the elements that are scrolling away.
We attempted to create a div with the same color as the body background, but this method failed when a background image was present. Another approach we tried was using jQuery to identify the elements in that section and hide them as they scroll, but this caused issues with elements larger than the header disappearing prematurely.
If this explanation is unclear, please feel free to ask any questions for further clarification.