W
W
William Miller2021-06-14 20:46:56
css
William Miller, 2021-06-14 20:46:56

Is it possible to hide a child element behind the parent using z-index?

There is such a layout 60c794be579a9919054908.png
As you noticed quotes behind the main element, that is, I created these quotes inside the main element and attached them to the top left edge with an absolute, I gave the parent z-index : 10 and even tried to give the quotes minus values, and the result is like this 60c79562ec405722508179.png
they don’t want for the parent at all hiding, and here the question arises, do child elements inherit the z-index value from the parent? Okay, after the parent quotes I defined z-index: -2 ! HELP!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Irkov, 2021-07-05
@mesaga1983

As already noted in the comments - you do not need to set the z-index of the parent, because then you will not be able to kill it from the heir. Just set the z-index to the absolute block and you will be happy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question