<分区>
我想知道如何在文本框中对齐搜索图标,就像 Google 的搜索栏一样
像这样:
这就是我得到的,但是我不知道怎么做:
我试图避免使用 Bootstrap 或任何库。我想尽可能地保持原汁原味。
#search-bar {
width: 32%;
color: white;
border-radius: 24px;
border-style: solid;
border-width: 1px;
border-color: white;
background-color: #2d2d2d;
height: 44px;
}
<form class="search-bar-form">
<input id="search-bar" type="text" href="#" />
<img src="https://via.placeholder.com/24" />
</form>