-2
I’m trying to reapply the same CSS from a login screen, in a registration that has 2 more inputs. However they don’t get the same configuration and I can’t find the error.
CSS is like this:
.input-field {
position: relative;
}
form .input-field:first-child {
margin-bottom: 1.5rem;
margin-top: 15px;
}
.input-field .underline::before {
content: " ";
position: absolute;
height: 1px;
width: 100%;
bottom: -5px;
left: 0;
background: rgb(0, 0, 0, 0.2);
}
.input-field .underline::after {
content: " ";
position: absolute;
height: 1px;
width: 100%;
bottom: -5px;
left: 0;
background: linear-gradient(90deg, rgba(240, 191, 9, 1) 0%, rgba(255, 154, 38, 1) 50%, rgba(255, 106, 0, 1) 100%);
transform: scaleX(0);
transition: all .3s ease-in-out;
transform-origin: left;
}
.input-field input:focus~.underline::after {
transform: scaleX(1);
}
form {
display: flex;
flex-direction: column;
}
.input-field input {
outline: none;
font-size: 0.9rem;
color: rgb(0, 0, 0, 0.7)
}
<form action="">
<div class="input-field">
<input type="text" name="nome" id="nome" placeholder="Digite seu nome">
<div class="underline"></div>
</div>
<div class="input-field">
<input type="text" name="username" id="username" placeholder="Digite seu usuário">
<div class="underline"></div>
</div>
<div class="input-field">
<input type="password" name="password" id="password" placeholder="Digite sua senha">
<div class="underline"></div>
</div>
<div class="input-field">
<input type="password" name="confirmpassword" id="confirmpassword" placeholder="Confirmar sua senha">
<div class="underline"></div>
</div>
This was done, but continues as in the image.
– Luiz Paulo Pinto
open the browser console and see if there is a missing file error
– BRABO
I used the code you posted and created an example in your question, if you check will not have the styles applied, sure you did not make mistakes in the classes and id’s?
– BRABO
is that it was basically copy and glue, just added two more inputs with the same class’s. That’s what’s weird.
– Luiz Paulo Pinto
Then it is because it should not be loading the file, check the browser console and see if there is no missing file error. It may be that the file path is wrong
– BRABO