In my CSS snippet, I have implemented an animation to move some label text when a user selects an input box.
input:focus ~ label, input.used ~ label {
top: -20px;
transform: scale(.75); left: -2px;
color: #4a89dc;
}
While this animation works well, I am encountering an issue where the label text animates back into place and overlaps the old text when I select a different input.
I am looking for a solution where the label text either disappears completely or remains in its new position without returning to its inactive state. In other words, it should not revert to its original position.