Closed iurygdeoliveira closed 1 year ago
body{
font-family: arial;
color: white;
background-color: #000821;
}
.input-group {
position: relative;
margin-bottom: 20px;
border: 2px solid rgb(255, 255, 255);
border-radius: 10px;
max-width: 400px;
background-color: #000821;
}
.input-group input[type="text"] {
height: 10px;
width: 100%;
border: none;
padding: 10px;
font-size: 16px;
background-color: #000821;
color: #fff;
border-radius: 10px;
box-sizing: border-box;
}
.input-group label {
position: absolute;
top: 50%;
left: 10px;
transform: translateY(-50%);
color: rgb(255, 255, 255);
font-size: 16px;
pointer-events: none;
transition: all 0.3s ease;
}
.input-group:hover label,
.input-group input[type="text"]:focus + label,
.input-group input[type="text"]:not(:focus):not(:placeholder-shown) + label {
top: -1px;
font-size: 12px;
color: rgb(255, 255, 255);
padding: 0px 2px;
background-color: #000821;
}
.input-group input[type="text"]:focus{
padding: 20px;
}
.input-group input[type="text"]:focus {
outline: none;
border: none;
}
.input-group input[type="text"]:not(:focus):not(:placeholder-shown) {
padding-top: 30px;
}
.input-group input[type="text"]:not(:focus):not(:placeholder-shown) + label {
top: 50%;
left: 10px;
transform: translateY(-50%);
font-size: 16px;
color: #999;
transition: all 0.3s ease;
}
body{
background-color: #000A26;
font-family: Arial, Helvetica, sans-serif;
margin: 20px;
}
.input-group{
position: relative;
color: #848ea0;
}
input{
border: solid 1.5px #848ea0;
border-radius: 15px;
background: none;
padding: 10px;
font-size: 0.5cm;
transition: 150ms cubic-bezier(.4, 0, .2, 1);
color: white;
}
label{
position: absolute;
top: -1px;
left: 20px;
pointer-events: none;
transition: 150ms cubic-bezier(.4, 0, .2, 1);
transform: translateY(1rem);
color: white;
}
input:focus{
outline: none;
border: 1.5px solid #848ea0;
}
input:focus ~ label{
transform: translateY(-50%) scale(1.1);
background:#000A26;
color: #848ea0;
font-size: 75%;
}
RESULTADO OBTIDO:
CSS APLICADO:
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap');
*{
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
}
body{
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #0c2136;
}
div.input-group{
width: 300px;
height: 50px;
position: relative;
}
div.input-group input{
width: 100%;
height: 100%;
background: transparent;
border: 2px solid #f0f0f0;
outline: none;
border-radius: 10px;
padding: 0px 10px ;
font-size: 16px;
color: white;
}
div.input-group label{
position: absolute;
left: 20px;
top: 18px;
text-transform: capitalize;
color: #f0f0f0;
font-size: 18px;
padding: 0px 4px;
transition: all 0.3s;
}
div.input-group input:focus ~ label{
top: -11px;
background-color: #0c2136;
transition: all 0.4s;
color: rgb(27, 117, 191);
}
div.input-group input:focus{
border:3px solid rgb(18, 103, 173) ;
}
body{ font-family: arial; color: white; background-color: #000821; }
.input-group { position: relative; margin-bottom: 20px; border: 2px solid rgb(255, 255, 255); border-radius: 10px; max-width: 400px; background-color: #000821; }
.input-group input[type="text"] { height: 10px; width: 100%; border: none; padding: 10px; font-size: 16px; background-color: #000821; color: #fff; border-radius: 10px; box-sizing: border-box;
}
.input-group label { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: rgb(255, 255, 255); font-size: 16px; pointer-events: none; transition: all 0.3s ease; }
.input-group:hover label, .input-group input[type="text"]:focus + label, .input-group input[type="text"]:not(:focus):not(:placeholder-shown) + label { top: -1px; font-size: 12px; color: rgb(255, 255, 255); padding: 0px 2px; background-color: #000821; }
.input-group input[type="text"]:focus{ padding: 20px; }
.input-group input[type="text"]:focus { outline: none; border: none; }
.input-group input[type="text"]:not(:focus):not(:placeholder-shown) { padding-top: 30px; }
.input-group input[type="text"]:not(:focus):not(:placeholder-shown) + label { top: 50%; left: 10px; transform: translateY(-50%); font-size: 16px; color: #999; transition: all 0.3s ease; }
Certa resposta, ponto pra equipe
Contact Details
iury.oliveira@ifto.edu.br
Challenge Description
Estilizar o HTML fornecido usando CSS de tal forma que o resultado se comporte como o gif animado abaixo
Additional tips
No repositorio da disciplina, existe um manual de referencia em CSS3, que pode ser util para a pesquisa e entendimento de códigos CSS