How is that possible at the source theme with the Code injection? I’ve already tried all sorts of tips here in the forum.
Try something like this in the header injection
<style>
#gh-navigation {
position: fixed;
top: 0;
width: 100%;
z-index: 200;
}
</style>
Thank you!!! Works perfect
Thank you. The code worked on my site great, only problem I have now is the fixed header is cutting off/overlapping on the top of my content on some pages. Do you know how to fix this?
Ah yes. I have this problem too…
yeah, the header looks great, but its overlapping with the top line of text which is unfortunate.
@klafbang Can you Help perhaps?
Its not the best solution. But for now it works. I will update the code again in the next days.
#gh-navigation { position: sticky; width: 100%; z-index: 1000; height: 56px; top: -7px; }Hello, it would be better if it could be fixed while scrolling the screen down. Let it slide up so that it does not appear on the screen when scrolling up, and fix it when scrolling down. This would be more useful.
Thanks @eigro. This works great with a little adjustment (header was shifting a bit when scrolling). Changed the “top:” parameter from -7px to 0, and now seems to work perfectly on desktop.
Is there a way to keep the announcement bar stuck with the nav on scroll?