2
How can I change another element with Pure CSS, from one element?
I tried to do this but it didn’t roll. I don’t know the CSS selectors and wonders in depth.
input {
display: block;
transition: top .3s, left .3s;
}
label {
position: relative;
top: 17px;
font-size: 12px;
left: 5px;
}
input:focus ~ label {
top: 0px;
left: 0px;
}
<label>Label</label>
<input type="text">
What I want to do is to focus on input, move the label up with pure CSS.
The label is to stay inside the same input?
– Jéf Bueno
I want to do the same thing as Materialize, when you click on the input the label goes back to its initial position. So I need to in the input Focus, change the position of the label and do not know if it is possible to do this with pure CSS, this is my hope. Abs
– Guilherme IA
Beauty. I think it would be important to have that description in the question.
– Jéf Bueno