1
ola found that answer https://jsfiddle.net/2a1kvcn6/1/ however I cannot keep the placeholder as title, once I type something it disappears, this way the box is without identification
.inputAnimado{
margin: 10px 25px;
width: 200px;
display: block;
border: none;
padding: 10px 0;
border-bottom: solid 1px #1abc9c;
-webkit-transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 96%, #1abc9c 4%);
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, #1abc9c 4%);
background-position: -200px 0;
background-size: 200px 100%;
background-repeat: no-repeat;
color: #0e6252;
}
.inputAnimado:focus, .inputAnimado:valid {
box-shadow: none;
outline: none;
background-position: 0 0;
}
.inputAnimado::-webkit-input-placeholder {
font-family: 'roboto', sans-serif;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.inputAnimado:focus::-webkit-input-placeholder, .inputAnimado:valid::-webkit-input-placeholder {
color: #1abc9c;
font-size: 11px;
-webkit-transform: translateY(-20px);
transform: translateY(-20px);
visibility: visible !important;
}
<input type="text" placeholder="Não quero sumir ao digitar" class="inputAnimado" required>
Please login to [Edit] and add your code. If it is only HTML, CSS and Javascript, you can add it by pressing
Ctrl+M
in the question editor.– Woss
Yes the test was done on Chrome
– Fabricio Silva
the problem is that when entering the input the placeholder is missing, I would like it to be.
– Fabricio Silva
Okay, I was misunderstanding the problem, I’m sorry.
– Woss
Perfect thinks he can give me a light, already researched I do not find the solution
– Fabricio Silva
Default behavior of text in
placeholder
is to disappear when text is inserted in the field.– lazyFox
exactly, if it disappears the input field information gets no description
– Fabricio Silva