Answers for "css pseudo element behind parent"

CSS
0

css pseudo element behind parent

.container {
  position: relative;
  z-index: 1;
}

.parent {
  position: relative;
  width: 200px;
  height: 200px;
  background: pink;
  /* No z-index allowed! */
}

.parent:before {
  position: absolute;
  width: 200px;
  height: 200px;
  left: 10px;
  top: 10px;
  z-index: -1;
}
Posted by: Guest on April-13-2021

Code answers related to "css pseudo element behind parent"

Browse Popular Code Answers by Language