Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
1) Wrap the input and label of the wrapper with position: relative;
2) Padding on top to fit the label
3) The label itself is position absolute; top: 0;
4) But actually we put the label right after the input
5) For the input we write: input:focus+label {color: red}
No way. If you rearrange the label below in the code, you can use sibling selectors (~ or +).
Otherwise, only scripts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question