In my HTML, there is an input box that works fine. Here is the code:
.lolan:placeholder-shown+.form__label {
opacity: 0;
visibility: hidden;
-webkit-transform: translateY(-4rem);
transform: translateY(-4rem);
}
<input class="lolan" type="text" id="name" placeholder="Full Name" required />
<label for="name" class="form__label">Click "Download" To Get Your Card</label>
Now, I wanted to add another label above the input box so it displays before any text is typed and hides after text is entered. Here is the code I tried:
.lolan:placeholder-shown - .form__labell {
opacity: 0;
visibility: hidden;
-webkit-transform: translateY(-4rem);
transform: translateY(-4rem);
}
<label for="name" class="form__labell">Click "Download" To Get Your Card</label>
<input class="lolan" type="text" id="name" placeholder="Full Name" required />
This modification is not working as expected. Can someone please help troubleshoot this?