Top fixed navbar issue

After adding a navbar on the top of my page, it left an empty space at the bottom of my body tag. does anyone know why this happens and how to fix it?

Do you have a codepen or some code that you can share?


for some reason my codepen looks way different than in my browser.

I would say your percentages are off. You have the Height of the body and Html set to 100% and the other containers set with percents as well. try changing them to add up to 100% and see how it does. Also consider adding margin-top to your top Div. Your content comes out at 91.98%, leaving the gap at the bottom in the body and content. Note that when the position is set to “fixed” it puts that content in front of the other.

1 Like