.your--bar {
position: fixed;
top: 0;
left: 0;
}
.the-element-below-your-bar {
margin-top: XYZpx (XYZ - the height of your bar)
}
When you set position to fixed, the element goes out of the normal flow and "floats" on top of the rest of the code. It means that the space that it used to occupy is now empty, which means that the element that goes right after your bar will take it up and will partly hide behind it. To fix this add margin-top to that element.
Closing Gap at Top of Page
in Customize with code
Posted · Edited by vsevolod
Hey, @kaydotjpg!
To fix the gap, do the following:
.your--bar { position: fixed; top: 0; left: 0; } .the-element-below-your-bar { margin-top: XYZpx (XYZ - the height of your bar) }
When you set position to fixed, the element goes out of the normal flow and "floats" on top of the rest of the code. It means that the space that it used to occupy is now empty, which means that the element that goes right after your bar will take it up and will partly hide behind it. To fix this add margin-top to that element.
Hope it helps!
Best regards,
Vsevolod