I have a dropdown menu that we moved up with some CSS so it would be right under the “services” button but now when I scroll down a page and the sticky header gets activated and I hover over “services” the drop down menu overlaps the main nav button. How can I get it so it’s always right under the button whether its the full sized header or the sticky header?
This is the page:
dev.cabra.ca
And this is the CSS we used to move it up and over:
ul.sub-menu{
margin-left:18%!important;
margin-top:-50%!important;
}
Hey musedesignca,
Please try this instead of that CSS:
header:not(.header_scrolled) ul.sub-menu{
margin-left:18%!important;
margin-top:-50%!important;
}
header.header-scrolled ul.sub-menu {
margin-left:18%!important;
margin-top:-18px !important;
}
Best regards,
Sarah
That code worked great for the desktop sub-menu but now when I look at the mobile hamburger menu it has moved up the sub items there too. How can I get this code above to only affect the desktop view? (and not the hamburger menu)?
Hi,
Please try this instead:
@media only screen and (min-width: 768px) {
header:not(.header_scrolled) ul.sub-menu{
margin-left:18%!important;
margin-top:-50%!important;
}
header.header-scrolled ul.sub-menu {
margin-left:18%!important;
margin-top:-18px !important;
}
}
Best regards,
Rikard
Thanks, that seems to be working now!