There is a block in which you need to make an "arrow" upward so that it is clear what kind of block it is. The problem is that it overlaps the content of the parent, i.e. it goes higher in z-index than the parent. By setting the z-index , nothing happens. How to fix this?
.block { width: 150px; height: 150px; background: red; margin: 50px auto; position: relative; z-index: 2; } .block:before { width: 20px; height: 20px; content: ''; background: #fff; display: block; position: absolute; left: 60px; transform: rotate(45deg); top: -10px; z-index: 1; background: #aaa; } <div class="block"> Some text here, guys </div>