D
D
Denis Bukreev2015-11-14 03:03:24
css
Denis Bukreev, 2015-11-14 03:03:24

Z-index - how to hide a child element behind the parent?

It's night outside, my head is breaking a
simple task, which, it seems, I encounter on a daily basis. the code looks like this:

<header> <!-- мамка -->
  <div id="header">
    <nav>
      <ul>
        <li>
          <ul> <!-- чадо -->

but imagine the code is like this:
<header> <!-- мамка - position:fixed; bg-color: white -->
        <li>
          <ul> <!-- чадо - position:absolute -->

How to hide the "child" under the "mother"?
What should be given to the intermediary <li>?
I’ve just been fighting for an hour, it seems to me that I’m just running a couple of methods in a circle and don’t move from a place. I
specially glued the test site: codepen.io/anon/pen/zvyMVZ
tags are different, but the essence is the same

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yaroslav Samardak, 2015-11-14
@yaroslav_samardak

So

J
jackie chan, 2015-11-14
@onvorobyov

z-index 1
z-index 0

D
Denis Vasiliev, 2015-11-14
@corvus007

ul {
  background-color: inherit;
}
codepen.io/corvus-007/pen/EVGJxm?editors=110

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question