0
[SOLVED] What is the issue with ':valid' selector here?
After entering text into username/password field when focus shifts, labels overlap the entered text. What I want is, when the input field is not empty labels should not move down. See line no. 74 My code: https://code.sololearn.com/WtCVVw1YbUQW
6 Answers
+ 2
Peter Parker use required
since u are using :valid u should use required too else :valid will not work
<input type="password" required>
https://code.sololearn.com/WSjM1m6Kd2Rj/?ref=app
+ 1
U have forget to use comma
â
.inputBox input:focus ~ label,
.inputBox input:valid ~ label
â
.inputBox input:focus ~ label
.inputBox input:valid ~ label
0
.box .inputBox input[type=text]:focus ~ label,
.box .inputBox input[type=password]:valid ~ label
{
/* your code */
}
0
HrCoder tried both, nothing happened
0
I just don't see anything overlapping .
0
Thanks HrCoder đ