Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #817914

    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;
    }

    #818000

    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

    #819663

    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)?

    #819813

    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

    #820228

    Thanks, that seems to be working now!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Dropdown menu overlapping main navigation on sticky header’ is closed to new replies.