css pseudo element behind parent

Solutions on MaxInterview for css pseudo element behind parent by the best coders in the world

showing results for - "css pseudo element behind parent"
Diego Alejandro
20 Mar 2019
1.container {
2  position: relative;
3  z-index: 1;
4}
5
6.parent {
7  position: relative;
8  width: 200px;
9  height: 200px;
10  background: pink;
11  /* No z-index allowed! */
12}
13
14.parent:before {
15  position: absolute;
16  width: 200px;
17  height: 200px;
18  left: 10px;
19  top: 10px;
20  z-index: -1;
21}