17K views
CSSAdd prefixes
1.card { 2 width: 190px; 3 padding: 1.9rem 1.2rem; 4 text-align: center; 5 background: #2a2b38; 6} 7 8/*Inputs*/ 9.field { 10 margin-top: .5rem; 11 display: flex; 12 align-items: center; 13 justify-content: center; 14 gap: .5em; 15 background-color: #1f2029; 16 border-radius: 4px; 17 padding: .5em 1em; 18} 19 20.input-icon { 21 height: 1em; 22 width: 1em; 23 fill: #ffeba7; 24} 25 26.input-field { 27 background: none; 28 border: none; 29 outline: none; 30 width: 100%; 31 color: #d3d3d3; 32} 33 34/*Text*/ 35.title { 36 margin-bottom: 1rem; 37 font-size: 1.5em; 38 font-weight: 500; 39 color: #f5f5f5; 40} 41 42/*Buttons*/ 43.btn { 44 margin: 1rem; 45 border: none; 46 border-radius: 4px; 47 font-weight: bold; 48 font-size: .8em; 49 text-transform: uppercase; 50 padding: 0.6em 1.2em; 51 background-color: #ffeba7; 52 color: #5e6681; 53 box-shadow: 0 8px 24px 0 rgb(255 235 167 / 20%); 54 transition: all .3s ease-in-out; 55} 56 57.btn-link { 58 color: #f5f5f5; 59 display: block; 60 font-size: .75em; 61 transition: color .3s ease-out; 62} 63 64/*Hover & focus*/ 65.field input:focus::placeholder { 66 opacity: 0; 67 transition: opacity .3s; 68} 69 70.btn:hover { 71 background-color: #5e6681; 72 color: #ffeba7; 73 box-shadow: 0 8px 24px 0 rgb(16 39 112 / 20%); 74} 75 76.btn-link:hover { 77 color: #ffeba7; 78} 79
HTML
1<div class="card"> 2 <h4 class="title">Log In!</h4> 3 <form> 4 <div class="field"> 5 <svg class="input-icon" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"> 6 <path d="M207.8 20.73c-93.45 18.32-168.7 93.66-187 187.1c-27.64 140.9 68.65 266.2 199.1 285.1c19.01 2.888 36.17-12.26 36.17-31.49l.0001-.6631c0-15.74-11.44-28.88-26.84-31.24c-84.35-12.98-149.2-86.13-149.2-174.2c0-102.9 88.61-185.5 193.4-175.4c91.54 8.869 158.6 91.25 158.6 183.2l0 16.16c0 22.09-17.94 40.05-40 40.05s-40.01-17.96-40.01-40.05v-120.1c0-8.847-7.161-16.02-16.01-16.02l-31.98 .0036c-7.299 0-13.2 4.992-15.12 11.68c-24.85-12.15-54.24-16.38-86.06-5.106c-38.75 13.73-68.12 48.91-73.72 89.64c-9.483 69.01 43.81 128 110.9 128c26.44 0 50.43-9.544 69.59-24.88c24 31.3 65.23 48.69 109.4 37.49C465.2 369.3 496 324.1 495.1 277.2V256.3C495.1 107.1 361.2-9.332 207.8 20.73zM239.1 304.3c-26.47 0-48-21.56-48-48.05s21.53-48.05 48-48.05s48 21.56 48 48.05S266.5 304.3 239.1 304.3z"></path></svg> 7 <input autocomplete="off" id="logemail" placeholder="Email" class="input-field" name="logemail" type="email"> 8 </div> 9 <div class="field"> 10 <svg class="input-icon" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"> 11 <path d="M80 192V144C80 64.47 144.5 0 224 0C303.5 0 368 64.47 368 144V192H384C419.3 192 448 220.7 448 256V448C448 483.3 419.3 512 384 512H64C28.65 512 0 483.3 0 448V256C0 220.7 28.65 192 64 192H80zM144 192H304V144C304 99.82 268.2 64 224 64C179.8 64 144 99.82 144 144V192z"></path></svg> 12 <input autocomplete="off" id="logpass" placeholder="Password" class="input-field" name="logpass" type="password"> 13 </div> 14 <button class="btn" type="submit">Login</button> 15 <a href="#" class="btn-link">Forgot your password?</a> 16 </form> 17</div>