Child element behind father

Asked

Viewed 117 times

-2

I have two father and son elements with Fixed position in both, how do I get the son to stand behind the father? I have a menu bottom (father), when clicked opens the submenu (son) with animation appearing behind the menu.

  • uses index https://developer.mozilla.org/en-US/docs/Web/CSS/z-index

  • It doesn’t work, by default the child picks up the z index of the parent.

  • 1

    Cara puts his entire code there, adds the question and puts the HTML and CSS of his menu with father, son etc... Just so I can give you a more precise answer.

  • 2

    Hi Charles! You can give an example of the HTML and CSS you already have. So it’s easier to help and give a good answer.

  • Post your comic so we can help you, and get a more precise answer as has been said.

1 answer

-1

Place the attribute: z-index: -1; in the child element. This will leave you behind the parent element

Browser other questions tagged

You are not signed in. Login or sign up in order to post.