Replies: 1 comment 1 reply
-
Instead of using an input group, I'd recommend setting the search icon as a background-image on the input itself and set it to display on the left and add some left-padding so the text input appears to begin to the left of the search icon. <style>
.form-control-search {
max-width: 300px;
background-color: transparent !important;
background-image: url(https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/icons/search.svg);
background-repeat: no-repeat;
background-position: 9px;
padding-left: 34px;
}
</style>
<div class="mx-auto col-11 mt-5">
<input class="form-control form-control-search" type="search" placeholder="Search docs">
</div> Quick Codepen demo here: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to create a search input?
Reduced test cases
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
Bootstrap v5.3.3
Beta Was this translation helpful? Give feedback.
All reactions