Mate, I am little confused with your statement mentioned here and your actual code. There is no such part as .head:after in your css code.
I am guessing you want your .head class to appear in the top of .head:before element. If that is the case then, you have assigned z-index to be wrong. z-index takes integer values both +ve and -ve . The larger the value of z-index you give, the more that element has priority to overlap other element.
for example
As a result the .div1 with appear in the top of .div2 because it has greater z-index than that of .div2.
It doesn’t matter how large the value I provide, I could have provide value of 2 instead of 4 in z-index of .div1 which would still do the same.
I hope, it helped.
Sorry If I misunderstood your question.
My bad, it was .head:before. Yes i have given the z-index of .head:before to be 1 while for .head it was 2. so aqua colored square should move to background and circle should come to front right? I’m not getting that result. Thanks for your reply !