When I apply a :before or :after pseudo element, this one gets hidden if the parent element uses a background.
You can notice that on this picture, where the red elements gets hidden behind the yellow background. Unlike its parent, the blue element.
.parent {
  background: yellow;
}
#element {
  position: relative;
  width: 100px;
  height: 100px;
  background-color: blue;
  border: 4px solid black;
}
#element::after {
  content: "";
  width: 150px;
  height: 150px;
  background-color: red;
  position: absolute;
  z-index: -1;
  border: 4px solid black;
}<div class="parent">
  <div id="element"></div>
</div>Reproduction online: https://jsfiddle.net/subkrovy/
Any way to go around this?

 
    