5.6K views
CSSAdd prefixes
1.form { 2 display: flex; 3 flex-direction: column; 4 gap: 10px; 5 padding-left: 2em; 6 padding-right: 2em; 7 padding-bottom: 0.4em; 8 background-color: #171717; 9 border-radius: 25px; 10 transition: .4s ease-in-out; 11} 12 13.form:hover { 14 transform: scale(1.05); 15 border: 1px solid black; 16} 17 18#heading { 19 text-align: center; 20 margin: 2em; 21 color: rgb(255, 255, 255); 22 font-size: 1.2em; 23} 24 25.field { 26 display: flex; 27 align-items: center; 28 justify-content: center; 29 gap: 0.5em; 30 border-radius: 25px; 31 padding: 0.6em; 32 border: none; 33 outline: none; 34 color: white; 35 background-color: #171717; 36 box-shadow: inset 2px 5px 10px rgb(5, 5, 5); 37} 38 39.input-icon { 40 height: 1.3em; 41 width: 1.3em; 42 fill: white; 43} 44 45.input-field { 46 background: none; 47 border: none; 48 outline: none; 49 width: 100%; 50 color: #d3d3d3; 51} 52 53.form .btn { 54 display: flex; 55 justify-content: center; 56 flex-direction: row; 57 margin-top: 2.5em; 58} 59 60.button1 { 61 padding: 0.5em; 62 padding-left: 1.1em; 63 padding-right: 1.1em; 64 border-radius: 5px; 65 margin-right: 0.5em; 66 border: none; 67 outline: none; 68 transition: .4s ease-in-out; 69 background-color: #252525; 70 color: white; 71} 72 73.button1:hover { 74 background-color: black; 75 color: white; 76} 77 78.button2 { 79 padding: 0.5em; 80 padding-left: 2.3em; 81 padding-right: 2.3em; 82 border-radius: 5px; 83 border: none; 84 outline: none; 85 transition: .4s ease-in-out; 86 background-color: #252525; 87 color: white; 88} 89 90.button2:hover { 91 background-color: black; 92 color: white; 93} 94 95.button3 { 96 margin-bottom: 3em; 97 padding: 0.5em; 98 border-radius: 5px; 99 border: none; 100 outline: none; 101 transition: .4s ease-in-out; 102 background-color: #252525; 103 color: white; 104} 105 106.button3:hover { 107 background-color: red; 108 color: white; 109}
HTML
1<form class="form"> 2 <p id="heading">Login</p> 3 <div class="field"> 4 <svg class="input-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> 5 <path d="M13.106 7.222c0-2.967-2.249-5.032-5.482-5.032-3.35 0-5.646 2.318-5.646 5.702 0 3.493 2.235 5.708 5.762 5.708.862 0 1.689-.123 2.304-.335v-.862c-.43.199-1.354.328-2.29.328-2.926 0-4.813-1.88-4.813-4.798 0-2.844 1.921-4.881 4.594-4.881 2.735 0 4.608 1.688 4.608 4.156 0 1.682-.554 2.769-1.416 2.769-.492 0-.772-.28-.772-.76V5.206H8.923v.834h-.11c-.266-.595-.881-.964-1.6-.964-1.4 0-2.378 1.162-2.378 2.823 0 1.737.957 2.906 2.379 2.906.8 0 1.415-.39 1.709-1.087h.11c.081.67.703 1.148 1.503 1.148 1.572 0 2.57-1.415 2.57-3.643zm-7.177.704c0-1.197.54-1.907 1.456-1.907.93 0 1.524.738 1.524 1.907S8.308 9.84 7.371 9.84c-.895 0-1.442-.725-1.442-1.914z"></path> 6 </svg> 7 <input autocomplete="off" placeholder="Username" class="input-field" type="text"> 8 </div> 9 <div class="field"> 10 <svg class="input-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> 11 <path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"></path> 12 </svg> 13 <input placeholder="Password" class="input-field" type="password"> 14 </div> 15 <div class="btn"> 16 <button class="button1"> Login </button> 17 <button class="button2">Sign Up</button> 18 </div> 19 <button class="button3">Forgot Password</button> 20</form>