Answers for "css before behind element"

CSS
0

css before behind element

.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

Browse Popular Code Answers by Language