Viewing 2 replies - 1 through 2 (of 2 total)
  • Ryan Phillips

    (@ryanphillips)

    Hey Michael!

    The reason the submenu is appearing under the other elements on the page is because of the parent-to-child relationship the submenu has with the navbar.

    The .tm-navbar container is a parent of the submenu and has a z-index of 2, so any child of that element will only ever have a z-index equivalent to 2 on that level of the DOM. CSS-Tricks has a good explanation of this on their website:

    https://css-tricks.com/almanac/properties/z/z-index/

    The top comment on that article is also worth the read as it explains the point about the different levels of the DOM.

    Based on the above, the 9999999999 z-index setting you have applied to the submenu itself won’t have the desired effect because it’s still only seen as a 2.

    To bring the submenu above the other page elements, you would need to set it’s parent element (the navbar) to have a z-index higher than 2, like so:

    .tm-navbar {
        z-index: 3;
    }

    Can you give that a try in your CSS for me?

    Thanks!

    Ryan

    Thread Starter michaellanfield

    (@michaellanfield)

    thank you. I tried to add the code like you said in Custom css under navbar and also tried it in style.css in childtheme, no luck.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Why is submenu below all other content?’ is closed to new replies.