Attach dropdown menu to navbar and set z-index

Hi there

We’re using the PRO theme to build our website. On several pages we’ve created a second menu bar with anchor tag. This one is initially hidden and shows up as soon as you start scrolling. That looks great.

Our single problem is that if this thin bar is not visible the dropdown menu has a white space to the main navigation. Is there a way to attach it directly to the main navigation and set the z-index to display it on top of the second menu bar?

The url to the website is: http://schaffh4.myhostpoint.ch/

Thanks for your help!

Best, Christian

Hi Christian,

Thanks for reaching out.

I checked and you have existing custom CSS that pushes it down

.sub-menu {
    margin-top: 36px !important;
}

Please remove it, I’m not sure where it’s placed since it’s minified but the theme or builder doesn’t use that static CSS.

Thanks!

Hi Rad

You’re right. I removed the CSS. Now it’s aligned directly below the main navbar.
Now the drop down menu was partially hidden below the thin black menu bar.

Now I changed the z-index to a number which is smaller than the one on the top and it works.

Thanks a lot :slight_smile:

On behalf of my colleague, you’re welcome. Cheers! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.