CodePen

HTML

            
              <div class="div1">1
  <div class="div2">2</div>
</div>

            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              .div1, .div2 {
  display: inline-block;
  width: 250px;
  height: 250px;
  border-collapse: collapse;
}

.div1 {
  border: 1px solid #000;
  background-color: red;
  color: black;
}

.div2 {
  position: absolute;
  left: 5px; /* 8px lines them completely over each other */
  top: 5px; /* 8px lines them completely over each other */
  color: white;
  border: 1px solid orange;
  z-index: 9999;
  background-color: blue;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................