2 "fixed" sections causing gap
Hello, Could anyone help me figure out why this gap is occurring and how to fix it?
It is the gap on-top of the slide out menu when fully out, I want the slide out menu to have priority over the header, but there is a gap that forms, and is un-fillable , only fixable if I remove one of the positions "fixed" but then they wouldn't work as intended to.
the menu is supposed to hide when scrolling down and appear as you scroll up.
the slide out menu is supposed to take up all the screen from corner to corner.
Thank you, and I appreciate the help.
https://codepen.io/Eddiev10/pen/zYVBxRQ
https://codepen.io/Eddiev10/pen/zYVBxRQ
4 Replies
h1 element have default margin on them that is probably why there is a gap 🙂
if you edit the #navbar in css, to position="relative" that is exactly what I want
why do you use position fixed if you gonna hide the navbar when user scrolls ??
You were right, it was margin. 3 hours later and I found out that on a section on my website I was doing margin-top, and I took off margin on that area and it worked, and then I came back and did the universal *{
*Universal *{margin: 0;}
and it worked. Thanks man.