I am trying to display the word "test" by focusing on a text input. However, when the text input is focused, the z-index of the text should change to 0 but it's not working as expected. I have provided my code below:
.text{
position: absolute;
z-index: -1;
}
.main{
background: #ababab;
}
.input-textbox input:focus + span {
z-index: 0;
}
<div class="main">
<div class="textbox">
<input type="text" class="input-textbox">
<span class="text">test</span>
</div>
</div>