I am trying a simple thing using z-index. But it is not working. Can anyone help me?
Please check the code. The blue background should go below, but it is not.
.btn {
padding: 15px 20px;
background: white;
border-radius: 20px;
border: 1px solid red;
position: relative;
z-index: 10;
}
.btn:before {
content: "";
width: 100%;
height: 100%;
background: blue;
position: absolute;
display: inline-block;
left: 0;
top: 0;
border-radius: 20px;
z-index: 5;
}
<a class="btn" href="#">Paynow</a>