1.2K views
CSSAdd prefixes
1.container-input { 2 position: relative; 3} 4 5.input { 6 width: 150px; 7 padding: 10px 0px 10px 40px; 8 border-radius: 9999px; 9 border: solid 1px #333; 10 transition: all .2s ease-in-out; 11 outline: none; 12 opacity: 0.8; 13} 14 15.container-input svg { 16 position: absolute; 17 top: 50%; 18 left: 10px; 19 transform: translate(0, -50%); 20} 21 22.input:focus { 23 opacity: 1; 24 width: 250px; 25}
HTML
1<div class="container-input"> 2 <input type="text" placeholder="Search" name="text" class="input"> 3 <svg fill="#000000" width="20px" height="20px" viewBox="0 0 1920 1920" xmlns="http://www.w3.org/2000/svg"> 4 <path d="M790.588 1468.235c-373.722 0-677.647-303.924-677.647-677.647 0-373.722 303.925-677.647 677.647-677.647 373.723 0 677.647 303.925 677.647 677.647 0 373.723-303.924 677.647-677.647 677.647Zm596.781-160.715c120.396-138.692 193.807-319.285 193.807-516.932C1581.176 354.748 1226.428 0 790.588 0S0 354.748 0 790.588s354.748 790.588 790.588 790.588c197.647 0 378.24-73.411 516.932-193.807l516.028 516.142 79.963-79.963-516.142-516.028Z" fill-rule="evenodd"></path> 5</svg> 6</div> 7