There are 2 div:
.d1 { position: fixed; left: 0; top: 0; width: 100px; height: 100px; background-color: black; z-index: 1; } .d2 { position: fixed; left: 0; top: 0; width: 100px; height: 100px; color: yellow; z-index: 2; }
<div class="d1"></div> <div class="d2"></div>
The first div (.d1) overlaps the second. It should be the other way around. What could be the problem?