Archived topic
Sticky Topbar and sticky nav
5 replies · Started by Petri on July 30, 2021
Hi Support,
I'm using the Pivot theme and added a topbar widget.
I want the topbar and the primary navigation to be sticky.
- I added this css for the topbar to be sticky:
.top-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
}
.admin-bar .top-bar {
top: 32px;
}
- And turned on Sticky navigation in the customizer.
But now when scrolling down the sticky navbar is displayed over the topbar...
Thank you for having a look (please see the URL in the private field)
Hi there,
try adding this CSS to create space for your Top Bar and to stop the sticky nav from overlapping the top bar:
.header-wrap .site-header {
margin-top: 49px;
}
#sticky-navigation {
top: 49px !important;
}
Hi David,
Thank you, this works fine on large screens.
However on tablet (portrait) and mobile I no longer see the mobile navigation (hamburger) anywhere...
Try this CSS:
#mobile-header {
margin-top: 48px;
}
Thanks Leo, that seems to work!
No problem :)