4.2K views
CSSAdd prefixes
1.group { 2 display: flex; 3 line-height: 28px; 4 align-items: center; 5 position: relative; 6 max-width: 190px; 7} 8 9.input { 10 height: 40px; 11 line-height: 28px; 12 padding: 0 1rem; 13 width: 100%; 14 padding-left: 2.5rem; 15 border: 2px solid transparent; 16 border-radius: 8px; 17 outline: none; 18 background-color: #D9E8D8; 19 color: #0d0c22; 20 box-shadow: 0 0 5px #C1D9BF, 0 0 0 10px #f5f5f5eb; 21 transition: .3s ease; 22} 23 24.input::placeholder { 25 color: #777; 26} 27 28.icon { 29 position: absolute; 30 left: 1rem; 31 fill: #777; 32 width: 1rem; 33 height: 1rem; 34} 35 36 37 38 39 40
HTML
1<div class="group"> 2 <svg class="icon" aria-hidden="true" viewBox="0 0 24 24"> 3 <g> 4 <path d="M21.53 20.47l-3.66-3.66C19.195 15.24 20 13.214 20 11c0-4.97-4.03-9-9-9s-9 4.03-9 9 4.03 9 9 9c2.215 0 4.24-.804 5.808-2.13l3.66 3.66c.147.146.34.22.53.22s.385-.073.53-.22c.295-.293.295-.767.002-1.06zM3.5 11c0-4.135 3.365-7.5 7.5-7.5s7.5 3.365 7.5 7.5-3.365 7.5-7.5 7.5-7.5-3.365-7.5-7.5z"></path> 5 </g> 6 </svg> 7 <input placeholder="Search" type="search" class="input"> 8</div>