<div class="infront">
  <code>z-index: 2</code>
</div>
<div class="behind">
  <code>z-index: 1</code>
</div>
div {
  width: 200px;
  height: 80px;
  position: relative;
  padding: 16px;
  font-family: monospace;
}

.infront {
  background-color: #eee;
  top: 70px;
  left: 120px;
  z-index: 2;
  color: #222;
}

.behind {
  background-color: #444;
  top: -80px;
  left: 35px;
  z-index: 1;
  color: #f1f1f1;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.