Link https://codepen.io/jabidgithub/pen/PoKZgeG
<section class="sec--5">
<a href="#" class="btn-ring">Naitours </a>
</section>
Here after applying z-index on before pseudo element the pseudo element goes under the section element.
Why it is not going only under the .btn-ring element ??
.sec--5 {
width: 100%;
height: 100vh;
display: grid;
place-items: center;
background: #eee;
}
.btn-ring {
display: inline-block;
text-transform: uppercase;
text-decoration: none;
font-size: 30px;
padding: 20px 40px;
color: #fff;
background-color: rgb(42, 248, 255);
border-radius: 50px;
position: relative;
}
.btn-ring::before {
content: "";
display: inline-block;
text-transform: uppercase;
text-decoration: none;
font-size: 30px;
color: #fff;
background-color: rgb(60, 91, 92);
border-radius: 50px;
width: 100%;
height: 100%;
position: absolute;
top: 10%;
left: 0;
z-index: -1;
}