G
G
Grizzy2016-01-09 02:06:36
css
Grizzy, 2016-01-09 02:06:36

How to make z-index work?

https://jsfiddle.net/nq6Lekav/
Need .block to be under .wrap. However, .block must remain nested.
HTML

<div class="wrap">
  <div class="block"></div>
</div>

css
.wrap {
  position: relative;
  z-index: 1;
}
.block {
  position: fixed;
  z-index: 0;
}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dima Pautov, 2016-01-09
@Grizzy

You cannot put a nested element through the z-index under the parent. IT IS FORBIDDEN! Make it more correct!

W
wonderlaw1, 2016-01-09
@wonderlaw1

Just like this)
https://jsfiddle.net/j0zLfLc2/

L
Loot, 2016-01-09
@Cesavel

https://jsfiddle.net/nq6Lekav/2/ if I understand correctly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question